@ -2,12 +2,12 @@
|
||||
|
||||
Learn to create an answering machine on the @boardname@
|
||||
|
||||
### ~avatar avatar
|
||||
## ~avatar avatar
|
||||
|
||||
|
||||
Let's learn how to create an answering machine!
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
We will use `show string` to show text on the LED screen. *String* is a common name for *text* in programming languages. The function `show string` scrolls the text column by column at a *150* milliseconds interval.
|
||||
|
||||
@ -15,9 +15,9 @@ We will use `show string` to show text on the LED screen. *String* is a common n
|
||||
basic.showString("ASK ME A QUESTION")
|
||||
```
|
||||
|
||||
### ~avatar boothing
|
||||
## ~avatar boothing
|
||||
|
||||
Excellent, you're ready to continue with the [challenges](/lessons/answering-machine/challenges)!
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
|
@ -10,7 +10,7 @@ Complete the [answering machine](/lessons/answering-machine/activity) activity a
|
||||
basic.showString("ASK ME A QUESTION")
|
||||
```
|
||||
|
||||
### Challenge 1
|
||||
## Challenge 1
|
||||
|
||||
Now we need to reply after someone asks @boardname@ a yes or no question. We want to respond `YES` when button `A` is pressed. Add a condition for button `A` and inside it show the string `YES`.
|
||||
|
||||
@ -23,7 +23,7 @@ input.onButtonPressed(Button.A, () => {
|
||||
|
||||
* `Run` the code to see if it works as expected.
|
||||
|
||||
### Challenge 2
|
||||
## Challenge 2
|
||||
|
||||
What if @boardname@'s answer to the question is no? Let's have `NO` be displayed when button `B` is pressed. Add a condition for button `B` and inside it show the string `NO`.
|
||||
|
||||
@ -40,6 +40,6 @@ input.onButtonPressed(Button.B, () => {
|
||||
|
||||
* `Run` the code to see if it works as expected.
|
||||
|
||||
### Challenge 3
|
||||
## Challenge 3
|
||||
|
||||
When you are asked a yes or no question, do you always say yes or no? Add a condition for `on shake` that displays `MAYBE`.
|
@ -2,11 +2,11 @@
|
||||
|
||||
Generate and show a beautiful image.
|
||||
|
||||
### ~avatar avatar
|
||||
## ~avatar avatar
|
||||
|
||||
Let's learn how to show an image on the LED screen.
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
We will use *show LEDs* to draw an image on the LED screen. This function immediately writes on the screen.
|
||||
|
||||
@ -20,9 +20,9 @@ basic.showLeds(`
|
||||
`)
|
||||
```
|
||||
|
||||
### ~avatar boothing
|
||||
## ~avatar boothing
|
||||
|
||||
Excellent, you're ready to continue with the [challenges](/lessons/beautiful-image/challenges)!
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
|
@ -16,7 +16,7 @@ basic.showLeds(`
|
||||
`)
|
||||
```
|
||||
|
||||
### Challenge 1
|
||||
## Challenge 1
|
||||
|
||||
Now show an new image that will display on the @boardname@.
|
||||
|
||||
@ -39,7 +39,7 @@ basic.showLeds(`
|
||||
|
||||
* Does your code work as expected?
|
||||
|
||||
### Challenge 2
|
||||
## Challenge 2
|
||||
|
||||
Nice job! Why don't we create a third image that will show after the other two?
|
||||
|
||||
|
@ -2,9 +2,9 @@
|
||||
|
||||
Beautiful Image tutorial.
|
||||
|
||||
### ~avatar avatar
|
||||
## ~avatar avatar
|
||||
|
||||
### @video td/videos/beautiful-image-0
|
||||
## @video td/videos/beautiful-image-0
|
||||
|
||||
Rebuild the game!
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
Turn an LED on and off with forever
|
||||
|
||||
### ~avatar avatar
|
||||
## ~avatar avatar
|
||||
|
||||
```sim
|
||||
basic.forever(() => {
|
||||
@ -14,7 +14,7 @@ basic.forever(() => {
|
||||
```
|
||||
Let's build a blinking light!
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
Have you ever tried to blink a flashlight at night? The concept is fairly simply: turn on the light, wait for a little, turn off the light, wait again, and repeat. That's exactly what we need to code to get a blinking LED.
|
||||
|
||||
@ -53,9 +53,9 @@ basic.forever(() => {
|
||||
})
|
||||
```
|
||||
|
||||
### ~avatar boothing
|
||||
## ~avatar boothing
|
||||
|
||||
Excellent, you're ready to continue with the [challenges](/lessons/blink/challenges)!
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
|
@ -15,7 +15,7 @@ basic.forever(() => {
|
||||
})
|
||||
```
|
||||
|
||||
### Challenge 1
|
||||
## Challenge 1
|
||||
|
||||
Let's display a "smiley face" on the screen! We'll start by plotting the eyes.
|
||||
|
||||
@ -34,7 +34,7 @@ basic.forever(() => {
|
||||
})
|
||||
```
|
||||
|
||||
### Challenge 2
|
||||
## Challenge 2
|
||||
|
||||
Let's add the code to plot the mouth by using `plot` and `unplot` to the following coordinates: (1,4), (2,4) and (3,4). When you're ready, don't forget to run your code to try it out!
|
||||
|
||||
@ -57,7 +57,7 @@ basic.forever(() => {
|
||||
})
|
||||
```
|
||||
|
||||
### Challenge 3
|
||||
## Challenge 3
|
||||
|
||||
Let's keep using `plot` to convert the mouth into a smiley face.
|
||||
|
||||
@ -69,11 +69,11 @@ Let's keep using `plot` to convert the mouth into a smiley face.
|
||||
0 1 1 1 0
|
||||
````
|
||||
|
||||
### Challenge 4
|
||||
## Challenge 4
|
||||
|
||||
Let's make it blink a bit faster. To do so, we need to reduce the amount of time used in ``pause`` to 100 milliseconds.
|
||||
|
||||
### Challenge 5
|
||||
## Challenge 5
|
||||
|
||||
Create your own image by changing the coordinates in `plot` and `unplot`!
|
||||
|
||||
|
@ -28,7 +28,7 @@ basic.forever(() => {
|
||||
|
||||
Again, test the code in the simulator. Try clicking **Button A** to display the "hello, world!" message every time the `button is pressed`.
|
||||
|
||||
### More 'if' statements
|
||||
## More 'if' statements
|
||||
|
||||
You could now add additional conditions to your 'if statement'. Here are some ideas:
|
||||
|
||||
|
@ -34,7 +34,7 @@ input.onButtonPressed(Button.B, () => {
|
||||
})
|
||||
```
|
||||
|
||||
### Challenge 1
|
||||
## Challenge 1
|
||||
|
||||
Now let's add some more types of instructions for the player to follow. Let's add `PRESS PIN 0`.
|
||||
Change the global variable `action` to `math->random(4)` so that we can add a new **IF** statement that checks if `action=3`. If it does, display instructions to press pin 0.
|
||||
@ -58,7 +58,7 @@ export function newAction() {
|
||||
}
|
||||
```
|
||||
|
||||
### Challenge 2
|
||||
## Challenge 2
|
||||
|
||||
Now let's implement `PRESS PIN 0` in the main. Create a condition of `input->on pin pressed("P0")` that will add one to the score and calls the method `new action`.
|
||||
|
||||
@ -80,7 +80,7 @@ input.onPinPressed(TouchPin.P0, () => {
|
||||
})
|
||||
```
|
||||
|
||||
### Challenge 3
|
||||
## Challenge 3
|
||||
|
||||
Add `POINT ME NORTH` to the list of possible commands.
|
||||
|
||||
|
@ -10,29 +10,29 @@ Use this activity document to guide your work in the [bop it activity](/lessons/
|
||||
|
||||
Answer the questions while completing the tutorial. Pay attention to the dialogues!
|
||||
|
||||
### 1. Write the code that will store the global variable named 'action' and returns a random number between 0 and 2
|
||||
## 1. Write the code that will store the global variable named 'action' and returns a random number between 0 and 2
|
||||
|
||||
<br/>
|
||||
|
||||
### 2. Write the code that will display the string, "PUSH A" if the global variable called 'action' is equal to 0
|
||||
## 2. Write the code that will display the string, "PUSH A" if the global variable called 'action' is equal to 0
|
||||
|
||||
<br />
|
||||
|
||||
### 3. Write the code that increments the score if button A is pressed when the global variable called 'action' is equal to 1
|
||||
## 3. Write the code that increments the score if button A is pressed when the global variable called 'action' is equal to 1
|
||||
|
||||
<br />
|
||||
|
||||
### 4. Write the code that will display the string "LOGO DOWN" if the global variable called 'action' is equal to 1
|
||||
## 4. Write the code that will display the string "LOGO DOWN" if the global variable called 'action' is equal to 1
|
||||
|
||||
<br />
|
||||
|
||||
### 5. Write the code that increments the score if the @boardname@ logo is tilted down when the global variable called 'action' is equal to 1
|
||||
## 5. Write the code that increments the score if the @boardname@ logo is tilted down when the global variable called 'action' is equal to 1
|
||||
|
||||
<br />
|
||||
|
||||
### 6. Write the code that will display the string "SHAKE" if the global variable called 'action' is equal to 2
|
||||
## 6. Write the code that will display the string "SHAKE" if the global variable called 'action' is equal to 2
|
||||
|
||||
<br />
|
||||
|
||||
### 7. Write the code that increments the score if the @boardname@ is shaken when the global variable called 'action' is equal to 2
|
||||
## 7. Write the code that increments the score if the @boardname@ is shaken when the global variable called 'action' is equal to 2
|
||||
|
||||
|
@ -25,15 +25,15 @@ basic.forever(() => {
|
||||
})
|
||||
```
|
||||
|
||||
### ~avatar avatar impressed
|
||||
## ~avatar avatar impressed
|
||||
|
||||
### Challenge 1
|
||||
## Challenge 1
|
||||
|
||||
Let's use an **IF** statement to detect if the egg and the basket are lined up.
|
||||
|
||||
Now that we know when an egg is caught, we can keep track of the score! We need to use the `add score` function built into the game library to add `1` point for every egg that is caught. However, let's not forget to `remove life` if an egg falls off the display before it's caught!
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
```blocks
|
||||
let basketX1 = 2
|
||||
@ -65,13 +65,13 @@ basic.forever(() => {
|
||||
|
||||
* Press the `run` button to test out your game.
|
||||
|
||||
### ~avatar avatar encourage
|
||||
## ~avatar avatar encourage
|
||||
|
||||
### Challenge 2
|
||||
## Challenge 2
|
||||
|
||||
Catching eggs gets easier with practice so let's make the eggs fall faster every 5 catches. We can do this by tracking how long the egg pauses in each position while falling with a global variable called **falling pause**. Let's create this variable and set it to `300` initially. Don't forget to also create a condition that will be true every 5 catches.
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
```blocks
|
||||
let basketX2 = 2
|
||||
@ -104,9 +104,9 @@ basic.forever(() => {
|
||||
})
|
||||
```
|
||||
|
||||
### ~avatar avatar surprised
|
||||
## ~avatar avatar surprised
|
||||
|
||||
### Challenge 3
|
||||
## Challenge 3
|
||||
|
||||
Let's make the egg fall faster by decreasing the amount of time it pauses in each position by decreasing **falling pause** by `25` every 5 catches. Now, instead of pausing for 300 milliseconds we can pause for the value of **falling pause**.
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
# catch the egg game tutorial
|
||||
|
||||
### Rebuild the game!
|
||||
## Rebuild the game!
|
||||
|
||||
The blocks have been shuffled! Put them back together so that...
|
||||
* an egg LED falls from the top of the screen, row by row.
|
||||
|
@ -2,12 +2,12 @@
|
||||
|
||||
Measure the acceleration on the @boardname@ in the "x" direction.
|
||||
|
||||
### ~avatar avatar
|
||||
## ~avatar avatar
|
||||
|
||||
Welcome! This activity will teach how to use the @boardname@ to chart the acceleration in the "x" direction. Let's get started!
|
||||
|
||||
|
||||
### ~
|
||||
## ~
|
||||
Let's measure `acceleration (mg)` in the "x" direction. Get the acceleration value (milli g-force), in one of three specified dimensions.
|
||||
|
||||
|
||||
@ -15,7 +15,7 @@ Let's measure `acceleration (mg)` in the "x" direction. Get the acceleration val
|
||||
input.acceleration(Dimension.X)
|
||||
```
|
||||
|
||||
### ~
|
||||
## ~
|
||||
Use the plot bar chart to visualize the acceleration on the LED screen of the @boardname@ in the specified range. You implement plot Bar Graph to display a vertical bar graph based on the "value" and "high" value. Then you must insert acceleration in the X dimension to measure the acceleration.
|
||||
|
||||
```blocks
|
||||
@ -25,25 +25,25 @@ basic.forever(() => {
|
||||
|
||||
```
|
||||
|
||||
### ~
|
||||
## ~
|
||||
Notice that moving the @boardname@ in the simulator from left to right (x direction) changes the values beneath the @boardname@ in a range from 1023 to -1023 as measured in milli-gravities. By hovering over the @boardname@ from left to right, you can observe changing values beneath the @boardname@ simulator. Also, the LEDs shown on the Bar Graph fluctates based on the movement of the @boardname@ simulator in the x direction. The line underneath the @boardname@ simulator reflect the acceleration in the x direction.
|
||||
|
||||
NOTE: The colors of the charts reflect the color of the @boardname@ simulator. In this instance, the @boardname@ is yellow. So the color of the data line reflects the color of the @boardname@
|
||||
|
||||

|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
Vigorously move the @boardname@ in the @boardname@ simulatator by moving the @boardname@ image from side to side. Every time the @boardname@ moves in the x direction in the simulator, you are generating data points that can be reviewed in Excel. The more attempts to move the @boardname@ from side to side, the more data being saved in Excel. After you have vigarously moved the @boardname@ simulator from side to side for a sufficient amount of time, you are ready to graph or chart the accceleration of the @boardname@. We want a printout of our acceleration on Excel that can be graphed in Excel.
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
We want to chart the data collected by using a tool in Excel.
|
||||
|
||||
The final part of this experiment is opening and reviewing the data in the Excel CSV file. Simply click on the line beneath the simulator. A CSV file will be generated to display the data points collected by moving the @boardname@ in the X direction. Then click or tap on the data Excel file that was downloaded to your local ``Downloads`` Folder.
|
||||
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
|
||||
First, click or tap on the first two columns (A, B) to include the time of the data being collected; b) the results of acceleration data on the @boardname@
|
||||
@ -60,9 +60,9 @@ Use the Recommended Charts command on the Insert tab to quickly create a chart t
|
||||
|
||||
* On the Recommended Charts tab, scroll through the list of chart types that Excel recommends for your data. Pick the **scatter plot**.
|
||||
|
||||
### ~avatar avatar
|
||||
## ~avatar avatar
|
||||
|
||||
Excellent, you're ready to continue with the [challenges](/lessons/charting/challenge)
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
|
@ -1,17 +1,17 @@
|
||||
# Challenge
|
||||
|
||||
### ~avatar avatar
|
||||
## ~avatar avatar
|
||||
|
||||
Welcome! The activity will teach you how to use the acceleration of the 1st @boardname@ and to visualize the acceleration on the 2nd @boardname@.
|
||||
Let's get started!
|
||||
|
||||
### ~
|
||||
## ~
|
||||
Let's measure `acceleration (mg)` and then `send number`. `Acceleration` is measured in **milli-gravities**, so a value of -1000 is equivalent to -1g or -9.81m/s^2. We will be able to get the acceleration value (g-force), in the specified "x" dimension. `Send number` will broadcast a number data packet to other @boardname@s connected via radio.
|
||||
|
||||
```blocks
|
||||
radio.sendNumber(input.acceleration(Dimension.X));
|
||||
```
|
||||
### ~
|
||||
## ~
|
||||
We want to display the acceleration forever. In order to do so, we need a `forever` loop. A forever loop will repeat code in the background forever.
|
||||
|
||||
```blocks
|
||||
@ -21,7 +21,7 @@ basic.forever(() => {
|
||||
|
||||
|
||||
```
|
||||
### ~
|
||||
## ~
|
||||
We want to register code to run when a packet is received over radio. We can implement this code by adding `on data received`.
|
||||
|
||||
```blocks
|
||||
@ -32,7 +32,7 @@ radio.onDataPacketReceived(() => {
|
||||
|
||||
})
|
||||
```
|
||||
### ~
|
||||
## ~
|
||||
Finally, we want to chart the acceleration. So we must first implement `plot bar graph`. `Plot Bar Graph` will display a vertical bar graph based on the value and high value. In order to transfer the receive the number from the 1st @boardname@, we must implement `receive number` to constantly display a vertical bar graph based on the value. Remember, the value will equal to the @boardname@'s acceleration in the "x" direction.
|
||||
|
||||
```blocks
|
||||
@ -44,20 +44,20 @@ radio.onDataPacketReceived(({ receivedNumber }) => {
|
||||
})
|
||||
|
||||
```
|
||||
### ~
|
||||
## ~
|
||||
Notice that moving the @boardname@ the farthest direction in the x direction will be -1023 on the charting beneath the simulator. The second observation will be that the LEDs will be full brightness on the 2nd @boardname@. There is a single LED turned on with the 1st @boardname@. Additionally, the graphs will reflect 0 acceleation for the 1st @boardname@. In this scenario, if you are adjusting the acceleration in the simualator, you are also changing your chart that will be produced.
|
||||
|
||||

|
||||
|
||||
### ~
|
||||
## ~
|
||||
NOTE: The colors of the charts reflect the color of the @boardname@ simulator. In this instance, the @boardname@s are blue and green. So the colors of the line graphs reflect the colors of the @boardname@
|
||||
|
||||
### ~
|
||||
## ~
|
||||
After running this simulation several seconds by moving the @boardname@ side to side in the x direction, you are ready to graph or chart the accceleration of the @boardname@. We want a printout of our acceleration on Excel. We will graph the fluctuating acceleration of the simulation experiment.
|
||||
|
||||

|
||||
|
||||
### ~
|
||||
## ~
|
||||
Finally, you must open the Excel CSV file by clicking on the data.xls file that was downloaded to Downloads Folder.
|
||||
|
||||

|
||||
@ -78,7 +78,7 @@ Use the Recommended Charts command on the Insert tab to quickly create a chart t
|
||||
|
||||

|
||||
|
||||
### ~
|
||||
## ~
|
||||
Have fun reviewing your simulation and analyze the acceleration by chart the Excel data using Excel.
|
||||
|
||||
* Connect the first @boardname@ to your computer using your USB cable and run the charting script on it.
|
||||
|
@ -47,8 +47,8 @@ input.onPinPressed(TouchPin.P1, () => {
|
||||
|
||||
* click *run* to see if the code works as expected.
|
||||
|
||||
### ~avatar boothing
|
||||
## ~avatar boothing
|
||||
|
||||
Excellent, you're ready to continue with the [challenges](/lessons/classic-beatbox/challenges)!
|
||||
|
||||
### ~
|
||||
## ~
|
@ -17,7 +17,7 @@ input.onPinPressed(TouchPin.P1, () => {
|
||||
})
|
||||
```
|
||||
|
||||
### Challenge 1
|
||||
## Challenge 1
|
||||
|
||||
Let's include a second sound `on pin pressed` *P2*. To do this, you need to add the same blocks as the banana keyboard activity. However, you must change alter `on pin pressed` from P1 to P2. Additionally, you must *decrease* the frequency of the variable "sound" by 25. Modify your code so that your code looks like this
|
||||
|
||||
@ -42,7 +42,7 @@ input.onPinPressed(TouchPin.P2, () => {
|
||||
|
||||
* click *run* to see if the code works as expected.
|
||||
|
||||
### Challenge 2
|
||||
## Challenge 2
|
||||
|
||||
Finally, we want images to be displayed with sounds `on pin pressed`. Add `show LEDs` blocks under `on pin pressed` P1 and P2.
|
||||
|
||||
|
@ -2,11 +2,11 @@
|
||||
|
||||
Display the direction that the @boardname@ is facing using the compass
|
||||
|
||||
### ~avatar avatar
|
||||
## ~avatar avatar
|
||||
|
||||
Welcome! This guided tutorial will show you how to program a script that displays the direction the @boardname@ is pointing. Let's get started!
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
Create a loop that will continuously update the reading of the compass.
|
||||
|
||||
@ -90,9 +90,9 @@ basic.forever(() => {
|
||||
});
|
||||
```
|
||||
|
||||
### ~avatar avatar
|
||||
## ~avatar avatar
|
||||
|
||||
Excellent, you're ready to continue with the [challenges](/lessons/compass/challenges)!
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
|
@ -24,7 +24,7 @@ basic.forever(() => {
|
||||
});
|
||||
```
|
||||
|
||||
### Challenge 1
|
||||
## Challenge 1
|
||||
|
||||
Instead of displaying `N` when the @boardname@ is pointing North, display a star to indicate the north star.
|
||||
|
||||
@ -54,7 +54,7 @@ basic.forever(() => {
|
||||
|
||||
* Run your code to see if it works as expected
|
||||
|
||||
### Challenge 2
|
||||
## Challenge 2
|
||||
|
||||
Instead of displaying just `N`, `W`, `S`, or `E`, display the full word.
|
||||
|
||||
@ -79,7 +79,7 @@ basic.forever(() => {
|
||||
|
||||
* Run your code to see if it works as expected
|
||||
|
||||
### Challenge 3
|
||||
## Challenge 3
|
||||
|
||||
Display your own unique message for each direction.
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
# counter lesson
|
||||
# Counter lesson
|
||||
|
||||
Learn how to create a counter with with on button pressed.
|
||||
Learn how to create a counter with with **on button** pressed.
|
||||
|
||||
## Topic
|
||||
|
||||
@ -13,9 +13,9 @@ Variables
|
||||
* [quiz](/lessons/counter/quiz)
|
||||
* [quiz answers](/lessons/counter/quiz-answers)
|
||||
|
||||
## Prior learning/place of lesson in scheme of work
|
||||
## Prior learning and lesson level
|
||||
|
||||
Learn how to creating a **variable** to keep track of the current count. We will be learning how to create a counter app using a variable as well as simple commands, such as on button pressed, and show number.
|
||||
Learn how to create a **variable** to keep track of the current count. We will be learning how to create a counter app using a variable and simple commands, such as on button pressed, and show number.
|
||||
|
||||
## Documentation
|
||||
|
||||
@ -34,10 +34,10 @@ basic.showLeds(`
|
||||
`)
|
||||
```
|
||||
|
||||
* **variable**: [read more...](/blocks/variables)
|
||||
* **arithmetic operators**: [read more...](/types/number)
|
||||
* **on button pressed** : [read more...](/reference/input/on-button-pressed)
|
||||
* **show number** : [read more...](/reference/basic/show-number)
|
||||
* **[variable](/blocks/variables)**:
|
||||
* **[arithmetic operators](/types/number)**
|
||||
* **[on button pressed](/reference/input/on-button-pressed)**
|
||||
* **[show number](/reference/basic/show-number)**
|
||||
|
||||
## Objectives
|
||||
|
||||
|
@ -2,11 +2,11 @@
|
||||
|
||||
Display a number with a variable.
|
||||
|
||||
### ~avatar avatar
|
||||
## ~avatar avatar
|
||||
|
||||
Welcome! This tutorial will teach you how to make a counter that increments when button A is pressed. Let's get started!
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
Let's start by creating a **local variable** `count` to keep track of the current count.
|
||||
|
||||
@ -35,9 +35,9 @@ input.onButtonPressed(Button.A, () => {
|
||||
```
|
||||
|
||||
|
||||
### ~avatar avatar
|
||||
## ~avatar avatar
|
||||
|
||||
Excellent, you're ready to continue with the [challenges](/lessons/counter/challenges)
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
|
@ -14,7 +14,7 @@ input.onButtonPressed(Button.A, () => {
|
||||
})
|
||||
```
|
||||
|
||||
### Challenge 1
|
||||
## Challenge 1
|
||||
|
||||
Let's add the code to `count` when `B` is pressed. Add an event handler with `on button pressed(B)` then add the code to `count`.
|
||||
|
||||
@ -31,7 +31,7 @@ input.onButtonPressed(Button.B, () => {
|
||||
})
|
||||
```
|
||||
|
||||
### Challenge 3
|
||||
## Challenge 3
|
||||
|
||||
Now let's try to reset the counter when the @boardname@ is shaken. You will need to register an event handler with `on shake`.
|
||||
|
||||
|
@ -2,11 +2,11 @@
|
||||
|
||||
Create a dice on the @boardname@
|
||||
|
||||
### ~avatar avatar
|
||||
## ~avatar avatar
|
||||
|
||||
Welcome! This tutorial will help you create a dice. Let's get started!
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
Let's create a condition for when the @boardname@ is shaken.
|
||||
|
||||
@ -161,9 +161,9 @@ input.onGesture(Gesture.Shake, () => {
|
||||
```
|
||||
|
||||
|
||||
### ~avatar avatar
|
||||
## ~avatar avatar
|
||||
|
||||
Excellent, you're ready to continue with the [challenges](/lessons/dice-roll/challenges)!
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
|
@ -60,7 +60,7 @@ input.onGesture(Gesture.Shake, () => {
|
||||
});
|
||||
```
|
||||
|
||||
### Challenge 1
|
||||
## Challenge 1
|
||||
|
||||
Modify the line of code with `pick random` so that only number 1-4 can appear on the dice.
|
||||
|
||||
@ -119,7 +119,7 @@ input.onGesture(Gesture.Shake, () => {
|
||||
});
|
||||
```
|
||||
|
||||
### Challenge 2
|
||||
## Challenge 2
|
||||
|
||||
Let's make a trick dice! Modify the line of code with `pick random` so that only numbers 3-6 can appear on the dice. Also note that we need to ensure `roll = 0` when only 1 dot is shown on the @boardname@.
|
||||
|
||||
@ -177,7 +177,7 @@ input.onGesture(Gesture.Shake, () => {
|
||||
});
|
||||
```
|
||||
|
||||
### Challenge 3
|
||||
## Challenge 3
|
||||
|
||||
Add a couple more conditions so that the @boardname@ randomly chooses a number between 1 and 8.
|
||||
|
||||
|
@ -2,11 +2,11 @@
|
||||
|
||||
Create a counter with a while loop.
|
||||
|
||||
### ~avatar avatar
|
||||
## ~avatar avatar
|
||||
|
||||
Welcome! This tutorial will teach how to create a counter with a while loop. Let's get started!
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
Create a variable that acts as a counter and set it to 0.
|
||||
|
||||
@ -50,9 +50,9 @@ while (count < 10) {
|
||||
```
|
||||
|
||||
|
||||
### ~avatar avatar
|
||||
## ~avatar avatar
|
||||
|
||||
Excellent, you're ready to continue with the [challenges](/lessons/digi-yoyo/challenges)!
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
|
@ -17,7 +17,7 @@ while (count < 10) {
|
||||
}
|
||||
```
|
||||
|
||||
### Challenge 1
|
||||
## Challenge 1
|
||||
|
||||
How about we create a counter that counts backwards from 10 to 1? Let's add a while loop that executes only when `count` is greater than 0.
|
||||
|
||||
@ -38,7 +38,7 @@ while (count > 0) {
|
||||
```
|
||||
|
||||
|
||||
### Challenge 2
|
||||
## Challenge 2
|
||||
|
||||
Inside of the while loop, let's add `pause->(1000)` so that we have a pause between each number as it's counting down. Also, let's show `count`!
|
||||
|
||||
@ -60,7 +60,7 @@ while (count > 0) {
|
||||
|
||||
* Run the code to see if it works as expected.
|
||||
|
||||
### Challenge 3
|
||||
## Challenge 3
|
||||
|
||||
Now, we need `count` to decrease by one after the @boardname@ has displayed the value of `count`.
|
||||
|
||||
|
@ -2,11 +2,11 @@
|
||||
|
||||
Control images with a variable.
|
||||
|
||||
### ~avatar avatar
|
||||
## ~avatar avatar
|
||||
|
||||
In this activity, you will learn how to blink an image on the LED screen.
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
Let's start by adding code that plots a heart image on the screen using `show LEDs`. Once you are done coding, don't forget to run your code in the simulator or the @boardname@.
|
||||
|
||||
@ -63,9 +63,9 @@ basic.forever(() => {
|
||||
```
|
||||
|
||||
|
||||
### ~avatar boothing
|
||||
## ~avatar boothing
|
||||
|
||||
Excellent, you're ready to continue with the [challenges](/lessons/flashing-heart/challenges)!
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
|
@ -23,7 +23,7 @@ basic.forever(() => {
|
||||
```
|
||||
|
||||
|
||||
### Challenge 1
|
||||
## Challenge 1
|
||||
|
||||
Let's plot a different image. Let's display a broken heart!
|
||||
|
||||
@ -56,7 +56,7 @@ basic.forever(() => {
|
||||
|
||||
* click *run main* to see if the code works as expected.
|
||||
|
||||
### Challenge 2
|
||||
## Challenge 2
|
||||
|
||||
Now let's alternate flashing the heart and the broken heart. To do this, we need to add a `clear screen` block and then add a `pause` block of 500 milliseconds under the new code we added in Challenge 1.
|
||||
|
||||
@ -90,7 +90,7 @@ basic.forever(() => {
|
||||
|
||||
* click *run main* to see if the code works as expected.
|
||||
|
||||
### Challenge 3
|
||||
## Challenge 3
|
||||
|
||||
You now have a heart and broken heart flashing! Now plot a new image to alternate in with the heart and broken heart.
|
||||
|
||||
|
@ -24,9 +24,9 @@ input.onButtonPressed(Button.A, () => {
|
||||
|
||||
|
||||
|
||||
### ~avatar boothing
|
||||
## ~avatar boothing
|
||||
|
||||
Excellent, you're ready to continue with the [challenges](/lessons/game-counter/challenges)!
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
|
@ -13,7 +13,7 @@ input.onButtonPressed(Button.A, () => {
|
||||
});
|
||||
```
|
||||
|
||||
### Challenge 1
|
||||
## Challenge 1
|
||||
|
||||
Let's add the code to `score` when `B` is pressed. Add an event handler with `on button (B) pressed` then add the code to `score`.
|
||||
|
||||
@ -31,7 +31,7 @@ input.onButtonPressed(Button.B, () => {
|
||||
```
|
||||
|
||||
|
||||
### Challenge 3
|
||||
## Challenge 3
|
||||
|
||||
Now let's try to reset the counter when the @boardname@ is shaken. You will need to register an event handler with `on shake`.
|
||||
|
||||
|
@ -8,9 +8,9 @@ We will use `show string` to show text on the LED screen. *String* is a common n
|
||||
basic.showString("SELECT A BUTTON")
|
||||
```
|
||||
|
||||
### ~avatar boothing
|
||||
## ~avatar boothing
|
||||
|
||||
Excellent, you're ready to continue with the [challenges](/lessons/game-of-chance/challenges)!
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
|
@ -11,7 +11,7 @@ basic.showString("SELECT A BUTTON")
|
||||
```
|
||||
|
||||
|
||||
### Challenge 1
|
||||
## Challenge 1
|
||||
|
||||
Now we need to to play the game of chance by responding to the message. We want to respond `YOU WIN` when button `A` is pressed. Add a condition for button `A` and inside it show the string `YOU WIN`.
|
||||
|
||||
@ -26,7 +26,7 @@ input.onButtonPressed(Button.A, () => {
|
||||
|
||||
* `Run` the code to see if it works as expected.
|
||||
|
||||
### Challenge 2
|
||||
## Challenge 2
|
||||
|
||||
What if @boardname@'s answer to the question is GAME OVER? Let's have `GAME OVER` be displayed when button `B` is pressed. Add a condition for button `B` and inside it show the `GAME OVER`.
|
||||
|
||||
@ -42,7 +42,7 @@ input.onButtonPressed(Button.B, () => {
|
||||
|
||||
* `Run` the code to see if it works as expected.
|
||||
|
||||
### Challenge 3
|
||||
## Challenge 3
|
||||
|
||||
When you are asked a yes or no question, do you always say yes or no? Add a condition for `on shake` that displays `TRY AGAIN`.
|
||||
|
||||
|
@ -100,9 +100,9 @@ basic.forever(() => {
|
||||
});
|
||||
```
|
||||
|
||||
### ~avatar avatar
|
||||
## ~avatar avatar
|
||||
|
||||
Excellent, you're ready to continue with the [challenges](/lessons/glowing-pendulum/challenges)!
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
|
@ -24,13 +24,13 @@ basic.forever(() => {
|
||||
|
||||
```
|
||||
|
||||
### Challenge 1
|
||||
## Challenge 1
|
||||
|
||||

|
||||
|
||||
Hold the @boardname@ in your hand in a dark room. Move the @boardname@ like a pendulum and produce a slow image that captures the pattern of the @boardname@ LEDs.
|
||||
|
||||
### Challenge 2
|
||||
## Challenge 2
|
||||
|
||||
Replace "y" in `acceleration(y)` with "x" or "z". Changing the axis will cause the @boardname@ to measure the force in a different direction. What differences in the resulting pattern does this replacement make?
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
The glowing pendulum changes the screen brightness based on the acceleration measured on the @boardname@.
|
||||
|
||||
### Rebuild the game!
|
||||
## Rebuild the game!
|
||||
|
||||
The blocks have been shuffled! Put them back together so that...
|
||||
* all LEDs are turned on
|
||||
|
@ -14,13 +14,13 @@ The @boardname@ has a grid of 25 LEDs, so we can use these to display images.
|
||||
|
||||
We’ve already experimented with the `show string` block that displays a string (some text) that we program it to. However we can use more blocks from the **Images** drawer to render or display images in different ways.
|
||||
|
||||
### Pixel Art
|
||||
## Pixel Art
|
||||
|
||||
We can draw little images from the LEDs by ticking boxes. Drag a `show image` block from the **Images** drawer and connect in a `create image` block. You can customize this image by clicking boxes to tick whether the LED will turn on or off. For example, if we were creating a music player we may want to the show the `play` block:
|
||||
|
||||

|
||||
|
||||
### Plotting points
|
||||
## Plotting points
|
||||
|
||||
We can also code our bug to plot a point by giving an x (horizontal) and y (vertical) coordinates, from 0 to 4. Click the **LED** drawer and drag a `plot` block. Try changing the coordinates and see the effect this has on the @boardname@.
|
||||
|
||||
@ -41,7 +41,7 @@ We can also use the `basic.clearScreen` block to turn off all LEDs.
|
||||
|
||||
The pause block is in milliseconds, so setting it to 1000 will have a pause of a single second.
|
||||
|
||||
### Devising algorithms for shapes
|
||||
## Devising algorithms for shapes
|
||||
|
||||
An algorithm is a set of steps to follow to solve a problem. We can begin to draw shapes on the @boardname@ using an algorithm.
|
||||
For example, we could draw a straight line with this code:
|
||||
@ -66,13 +66,13 @@ basic.forever(() => {
|
||||
})
|
||||
```
|
||||
|
||||
### Animations
|
||||
## Animations
|
||||
|
||||
Animations are changes happening at a certain rate. For example, we could add the `pause` block from the **Basic** drawer with our square algorithm – this will slowly draw a square (as an animation).
|
||||
|
||||
We could create more complex animations, for example we could make our @boardname@ display an explosion or fireworks.
|
||||
|
||||
### Image variables
|
||||
## Image variables
|
||||
|
||||
We can create image variables so we can easily display an image at a later point. For example:
|
||||
|
||||
|
@ -2,11 +2,11 @@
|
||||
|
||||
Guess the number with math random.
|
||||
|
||||
### ~avatar avatar
|
||||
## ~avatar avatar
|
||||
|
||||
Welcome! This tutorial will help you create a guess the number game! Let's get started!
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
Add an event handler when button `A` is pressed.
|
||||
|
||||
@ -37,9 +37,9 @@ input.onButtonPressed(Button.A, () => {
|
||||
|
||||
```
|
||||
|
||||
### ~avatar avatar
|
||||
## ~avatar avatar
|
||||
|
||||
Excellent, you're ready to continue with the [challenges](/lessons/guess-the-number/challenges)!
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
|
@ -13,7 +13,7 @@ input.onButtonPressed(Button.A, () => {
|
||||
})
|
||||
```
|
||||
|
||||
### Challenge 1
|
||||
## Challenge 1
|
||||
|
||||
When button `B` is pressed, we want to clear the screen. This will make it so users can play your game over and over again! Add an event handler to handle this case.
|
||||
|
||||
@ -27,7 +27,7 @@ input.onButtonPressed(Button.B, () => {
|
||||
})
|
||||
```
|
||||
|
||||
### Challenge 2
|
||||
## Challenge 2
|
||||
|
||||
Show an animation when you clear the screen! Choose what animation makes most sense to you. Be creative!
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
# guess the number tutorial
|
||||
|
||||
### ~avatar avatar
|
||||
## ~avatar avatar
|
||||
|
||||
This tutorial will help you create a guess the number game! Let's get started!
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
### Rebuild the game!
|
||||
## Rebuild the game!
|
||||
|
||||
The blocks have been shuffled! Put them back together so that...
|
||||
* when the user presses button ``A``,
|
||||
|
@ -48,9 +48,9 @@ basic.pause(100);
|
||||
|
||||
* click run to see if the code works as expected.
|
||||
|
||||
### ~avatar boothing
|
||||
## ~avatar boothing
|
||||
|
||||
Excellent, you're ready to continue with the [challenges](/lessons/happy-birthday/challenges)!
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
|
@ -26,9 +26,9 @@ basic.pause(100);
|
||||
|
||||
```
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
### Challenge 1
|
||||
## Challenge 1
|
||||
|
||||
Let's code the third part of Happy Birthday!
|
||||
|
||||
@ -60,7 +60,7 @@ basic.pause(100);
|
||||
|
||||
* click *run * to see if the code works as expected.
|
||||
|
||||
### Challenge 2
|
||||
## Challenge 2
|
||||
|
||||
Finally, we continue to adding the appropriate `play` block and fit the following chords blocks `F`, `E`, `C`, `D` to complete the third part of the song. Modify your code so that your code looks like this.
|
||||
|
||||
@ -98,7 +98,7 @@ music.playTone(music.noteFrequency(Note.F), music.beat(BeatFraction.Quarter));
|
||||
|
||||
* click *run * to see if the code works as expected.
|
||||
|
||||
### Challenge 3
|
||||
## Challenge 3
|
||||
|
||||
You now have a the ability to create music on the @boardname@. Try to code another favourite song.
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
# headbands lesson
|
||||
# Headband lesson
|
||||
|
||||
create a charades game that can be played with your friends.
|
||||
Create a charades game to play with your friends.
|
||||
|
||||
## Topic
|
||||
|
||||
@ -42,13 +42,13 @@ Learn how to create a charades game with **collections**, ` create -> Collection
|
||||
## Documentation
|
||||
|
||||
* **collection**
|
||||
* **variables** : [read more...](/blocks/variables)
|
||||
* **Boolean** : [read more...](/blocks/logic/boolean)
|
||||
* **on logo up** [read more...](/reference/input/on-gesture)
|
||||
* **on screen down** [read more...](/reference/input/on-gesture)
|
||||
* **on screen up** [read more...](/reference/input/on-gesture)
|
||||
* **show string** : [read more...](/reference/basic/show-string)
|
||||
* **game library** : [read more...](/reference/game)
|
||||
* **[variables](/blocks/variables)**
|
||||
* **[Boolean](/blocks/logic/boolean)**
|
||||
* **[on logo up](/reference/input/on-gesture)**
|
||||
* **[on screen down](/reference/input/on-gesture)**
|
||||
* **[on screen up](/reference/input/on-gesture)**
|
||||
* **[show string](/reference/basic/show-string)**
|
||||
* **[game library](/reference/game)**
|
||||
|
||||
## Resources
|
||||
|
||||
@ -70,14 +70,14 @@ Learn how to create a charades game with **collections**, ` create -> Collection
|
||||
|
||||
## Progression Pathways / Computational Thinking Framework
|
||||
|
||||
#### Algorithms
|
||||
### Algorithms
|
||||
|
||||
* Designs solutions (algorithms) that use repetition and two-way selection, ie if, then and else.(AL)
|
||||
* Uses logical reasoning to predict outputs, showing an awareness of inputs (AL)
|
||||
* Recognises that different solutions exist for the same problem (AL) (AB) Understands that iteration is the repetition of a process such as a loop (AL)
|
||||
* Represents solutions using a structured notation (AL) (AB)
|
||||
|
||||
#### Programming & Development
|
||||
### Programming & Development
|
||||
|
||||
* Creates programs that implement algorithms to achieve given goals (AL)
|
||||
* Declares and assigns variables(AB)
|
||||
@ -87,20 +87,20 @@ Learn how to create a charades game with **collections**, ` create -> Collection
|
||||
* Uses a range of operators and expressions e.g. Boolean, and applies them in the context of program control. (AL)
|
||||
* Selects the appropriate data types(AL) (AB
|
||||
|
||||
#### Data & Data Representation
|
||||
### Data & Data Representation
|
||||
|
||||
* Understands the difference between data and information(AB)
|
||||
* Performs more complex searches for information e.g. using Boolean and relational operators(AL) (GE) (EV)
|
||||
|
||||
#### Hardware & Processing
|
||||
### Hardware & Processing
|
||||
|
||||
* Knows that computers collect data from various input devices, including sensors and application software (AB)
|
||||
|
||||
#### Communication Networks
|
||||
### Communication Networks
|
||||
|
||||
* Demonstrates responsible use of technologies and online services, and knows a range of ways to report concerns Understands how search engines rank search results (AL)
|
||||
|
||||
#### Information Technology
|
||||
### Information Technology
|
||||
|
||||
* Collects, organizes, and presents data and information in digital content (AB)
|
||||
* Makes appropriate improvements to solutions based on feedback received, and can comment on the success of the solution (EV)
|
||||
|
@ -22,7 +22,7 @@ input.onScreenDown(() => {
|
||||
game.startCountdown(30000)
|
||||
```
|
||||
|
||||
### Challenge 1
|
||||
## Challenge 1
|
||||
|
||||
Let's add more words for the player to act out! But first, we need to increase the time in one round to give the player more time get through all the words. Let's change the `game->start countdown` statement.
|
||||
|
||||
@ -47,7 +47,7 @@ game.startCountdown(60000)
|
||||
|
||||
* Run your code to see if it works as expected
|
||||
|
||||
### Challenge 2
|
||||
## Challenge 2
|
||||
|
||||
Now let's add 5 more words to our list of charade words. Right above the the line `word:=coll->at(index)` add 5 lines that say `coll->add("")`. In this example, we will add the words **bicycle, telephone, sun, car, and ant** but you can add whatever words you like.
|
||||
|
||||
@ -76,15 +76,15 @@ game.startCountdown(30000)
|
||||
|
||||
* Run your code to see if it works as expected.
|
||||
|
||||
### Challenge 3
|
||||
## Challenge 3
|
||||
|
||||
Remove a life using `game->remove life` when the screen is down using the `input->on screen down` event.
|
||||
|
||||
### Challenge 4
|
||||
## Challenge 4
|
||||
|
||||
The collection has a function `random` that returns a random element. Update your code to use this function instead of using `math->random`.
|
||||
|
||||
### Challenge 5!
|
||||
## Challenge 5!
|
||||
|
||||
Play the game and try guessing all these words in less than 2 minutes!
|
||||
|
||||
|
@ -2,11 +2,11 @@
|
||||
|
||||
A classic game, Hero, in which you must capture the food and flee away from the ghost!
|
||||
|
||||
### ~avatar avatar
|
||||
## ~avatar avatar
|
||||
|
||||
This tutorial will teach you how to create a hero game to capture food while dodging the ghost; the game was inspired by the classic arcade game Pac Man.
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
First we need to create a function create sprite at the x, y coordinates and that set the variable called hero on the @boardname@ the first time we play.
|
||||
|
||||
@ -270,9 +270,9 @@ ghost.set(LedSpriteProperty.X, 4);
|
||||
|
||||
```
|
||||
|
||||
### ~avatar avatar
|
||||
## ~avatar avatar
|
||||
|
||||
Congratulations! You have a homemade hero game based on the classic version of PacMan
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
|
@ -28,9 +28,9 @@ for (let i = 0; i < 6; i++) {
|
||||
}
|
||||
```
|
||||
|
||||
### ~avatar avatar
|
||||
## ~avatar avatar
|
||||
|
||||
Excellent, you're ready to continue with the [challenges](/lessons/looper/challenges)!
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
|
@ -18,7 +18,7 @@ for (let i = 0; i < 6; i++) {
|
||||
}
|
||||
```
|
||||
|
||||
### Challenge 1
|
||||
## Challenge 1
|
||||
|
||||
What if we want to count up to lucky number 7 instead? Let's do that by changing the ending value to `7` instead of `5`.
|
||||
|
||||
@ -33,7 +33,7 @@ for (let i = 0; i < 8; i++) {
|
||||
|
||||
* Run the program now to see your changes.
|
||||
|
||||
### Challenge 2
|
||||
## Challenge 2
|
||||
|
||||
What about 9? Let's do that by changing the ending value to `9`.
|
||||
|
||||
@ -49,7 +49,7 @@ for (let i = 0; i < 10; i++) {
|
||||
|
||||
* Run your code to see the new counter.
|
||||
|
||||
### Challenge 3
|
||||
## Challenge 3
|
||||
|
||||
Now let's start counting from `3` instead! Our for loop will always start at `0` so we simply add `3` to the `i` variable when passing it to `show number`.
|
||||
|
||||
@ -64,7 +64,7 @@ for (let i = 0; i < 10; i++) {
|
||||
|
||||
Run it on the simulator!
|
||||
|
||||
### Challenge 4
|
||||
## Challenge 4
|
||||
|
||||
Now, let's **count down from 9**. Change the line `show number(i + 2, 150)` to `show number(9 - i, 150)`.
|
||||
|
||||
@ -79,7 +79,7 @@ for (let i = 0; i < 10; i++) {
|
||||
|
||||
* Run the code to make sure it is doing what is expected.
|
||||
|
||||
### Challenge 5
|
||||
## Challenge 5
|
||||
|
||||
After counting down from `9` let's show the string `BOOOM`!
|
||||
|
||||
|
@ -2,11 +2,11 @@
|
||||
|
||||
Create a love meter with the @boardname@
|
||||
|
||||
### ~avatar avatar
|
||||
## ~avatar avatar
|
||||
|
||||
Welcome! This activity will help you create a love meter with the @boardname@. Let's get started!
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
Begin by registering an event with `on pin pressed` *P0* to know when someone is holding pin *P0* and pin *Gnd*.
|
||||
|
||||
@ -39,9 +39,9 @@ input.onPinPressed(TouchPin.P0, () => {
|
||||
|
||||
```
|
||||
|
||||
### ~avatar avatar
|
||||
## ~avatar avatar
|
||||
|
||||
Excellent, you're ready to continue with the [challenges](/lessons/love-meter/challenges)
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
|
@ -14,7 +14,7 @@ input.onPinPressed(TouchPin.P0, () => {
|
||||
|
||||
```
|
||||
|
||||
### Challenge 1
|
||||
## Challenge 1
|
||||
|
||||
Add a pause of 3000 milliseconds (3 seconds) after showing the number so that the number won't immediately disappear in the next challenge.
|
||||
|
||||
@ -27,7 +27,7 @@ input.onPinPressed(TouchPin.P0, () => {
|
||||
})
|
||||
```
|
||||
|
||||
### Challenge 2
|
||||
## Challenge 2
|
||||
|
||||
If the rating **x** is between *0* and *3* (strictly less than *4*), display the text "HORRIBLE!".
|
||||
|
||||
@ -43,7 +43,7 @@ input.onPinPressed(TouchPin.P0, () => {
|
||||
})
|
||||
```
|
||||
|
||||
### Challenge 3
|
||||
## Challenge 3
|
||||
|
||||
**If** the rating is between 4 and 7, display the text "MEDIOCRE!" **else** display the text "MATCHED!"
|
||||
|
||||
@ -63,7 +63,7 @@ input.onPinPressed(TouchPin.P0, () => {
|
||||
})
|
||||
```
|
||||
|
||||
### Challenge 4
|
||||
## Challenge 4
|
||||
|
||||
Use `show LEDs` to display images instead of text for each case.
|
||||
|
||||
|
@ -2,11 +2,11 @@
|
||||
|
||||
Show a number on the LED screen.
|
||||
|
||||
### ~avatar avatar
|
||||
## ~avatar avatar
|
||||
|
||||
Let's learn how to show the lucky number 7 on the LED screen.
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
We will use `show number` to display a number on the screen. The argument (`7`) is the number to display.
|
||||
|
||||
@ -14,9 +14,9 @@ We will use `show number` to display a number on the screen. The argument (`7`)
|
||||
basic.showNumber(7)
|
||||
```
|
||||
|
||||
### ~avatar boothing
|
||||
## ~avatar boothing
|
||||
|
||||
Excellent, you're ready to continue with the [challenges](/lessons/lucky-7/challenges)!
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
|
@ -10,7 +10,7 @@ Complete the [lucky 7 activity](/lessons/lucky-7/activity) and your code will lo
|
||||
basic.showNumber(7)
|
||||
```
|
||||
|
||||
### Challenge 1
|
||||
## Challenge 1
|
||||
|
||||
But we also should pause before showing another number. Let's add a pause of 500 milliseconds.
|
||||
|
||||
@ -19,7 +19,7 @@ basic.showNumber(7)
|
||||
basic.pause(500)
|
||||
```
|
||||
|
||||
### Challenge 2
|
||||
## Challenge 2
|
||||
|
||||
What about other multiples of 7? Let's display the next multiple of 7 on the screen!
|
||||
|
||||
@ -31,7 +31,7 @@ basic.showNumber(14)
|
||||
|
||||
* Run the code to see if it works as expected.
|
||||
|
||||
### Challenge 3
|
||||
## Challenge 3
|
||||
|
||||
Keep displaying multiples of 7 such as 21 and 28...
|
||||
|
||||
|
@ -4,9 +4,9 @@ Coding challenges for lucky 7.
|
||||
|
||||
###~ Avatar
|
||||
|
||||
### @video td/videos/lucky-7-1-2
|
||||
## @video td/videos/lucky-7-1-2
|
||||
|
||||
### Rebuild the game!
|
||||
## Rebuild the game!
|
||||
|
||||
The blocks have been shuffled! Put them back together so that…
|
||||
* The blocks should be multiples of 7 and a pause between the numbers
|
||||
@ -17,7 +17,7 @@ basic.pause(500)
|
||||
basic.showNumber(14)
|
||||
```
|
||||
|
||||
### Hints and tips
|
||||
## Hints and tips
|
||||
|
||||
Cut out these documentation cards to help you!
|
||||
|
||||
|
@ -114,9 +114,9 @@ input.onGesture(Gesture.Shake, () => {
|
||||
})
|
||||
```
|
||||
|
||||
### ~avatar avatar
|
||||
## ~avatar avatar
|
||||
|
||||
Excellent, you're ready to continue with the [challenges](/lessons/magic-8/challenges)!
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
|
@ -26,7 +26,7 @@ input.onGesture(Gesture.Shake, () => {
|
||||
```
|
||||
|
||||
|
||||
### Challenge 1
|
||||
## Challenge 1
|
||||
|
||||
Now let's increase the number of responses the magic 8 ball can give. How about 5 responses instead? Let's change the limit of `pick random` to 4.
|
||||
|
||||
@ -49,7 +49,7 @@ input.onGesture(Gesture.Shake, () => {
|
||||
})
|
||||
```
|
||||
|
||||
### Challenge 2
|
||||
## Challenge 2
|
||||
|
||||
Now have the magic 8 ball respond "Try again" if **randomNumber** is 3.
|
||||
|
||||
@ -73,7 +73,7 @@ input.onGesture(Gesture.Shake, () => {
|
||||
})
|
||||
```
|
||||
|
||||
### Challenge 3
|
||||
## Challenge 3
|
||||
|
||||
Now what about if **randomNumber** is 4? Let's have the magic 8 ball respond "Definitely!".
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
Show a string to instruct the user how to play Magic 8! The magic 8 ball can only answer questions with "YES", "NO", or "MAYBE"...
|
||||
|
||||
### Rebuild the game!
|
||||
## Rebuild the game!
|
||||
|
||||
The blocks have been shuffled! Put them back together so that...
|
||||
* show "ASK A QUESTION" on the screen
|
||||
|
@ -2,11 +2,11 @@
|
||||
|
||||
Show an image that points up when the logo is up.
|
||||
|
||||
### ~avatar avatar
|
||||
## ~avatar avatar
|
||||
|
||||
Welcome! This tutorial will help you display an arrow pointing toward the logo! Let's get started.
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
Using the **accelerometer** sensor, the @boardname@ can detect when the **logo** is oriented **up**. We call that the **logo up** event. We will use `on logo up` to register an event handler that will run when the **logo up** event happens.
|
||||
|
||||
@ -32,9 +32,9 @@ input.onGesture(Gesture.LogoUp, () => {
|
||||
|
||||
Run your code and try to turn around the @boardname@ to see the **logo up** event in action!
|
||||
|
||||
### ~avatar boothing
|
||||
## ~avatar boothing
|
||||
|
||||
Excellent, you're ready to continue with the [challenges](/lessons/magic-logo/challenges)!
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
|
@ -20,7 +20,7 @@ input.onLogoUp(() => {
|
||||
```
|
||||
|
||||
|
||||
### Challenge 1
|
||||
## Challenge 1
|
||||
|
||||
How about when the logo is down? We should display an arrow pointing downward!
|
||||
|
||||
@ -48,11 +48,11 @@ input.onLogoDown(() => {
|
||||
```
|
||||
|
||||
|
||||
### Challenge 2
|
||||
## Challenge 2
|
||||
|
||||
Use the `on screen up` event to show a spinning arrow when the screen is turned up.
|
||||
|
||||
### Challenge 3
|
||||
## Challenge 3
|
||||
|
||||
Display another animation using the `on screen up` event.
|
||||
|
||||
|
@ -2,11 +2,11 @@
|
||||
|
||||
Change the brightness of the @boardname@.
|
||||
|
||||
### ~avatar avatar
|
||||
## ~avatar avatar
|
||||
|
||||
Welcome! This tutorial will teach you how to change the brightness of the @boardname@. Let's get started!
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
The brightness of the LED screen can be changed by using the `set brightness` function. This function takes a number between ``0`` (off) and ``255`` (full brightness).
|
||||
|
||||
@ -57,9 +57,9 @@ input.onButtonPressed(Button.A, () => {
|
||||
|
||||
|
||||
|
||||
### ~avatar boothing
|
||||
## ~avatar boothing
|
||||
|
||||
Excellent, you're ready to continue with the [challenges](/lessons/night-light/challenges)!
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
|
@ -21,7 +21,7 @@ input.onButtonPressed(Button.A, () => {
|
||||
})
|
||||
|
||||
```
|
||||
### Challenge 1
|
||||
## Challenge 1
|
||||
|
||||
|
||||
|
||||
@ -46,6 +46,6 @@ input.onButtonPressed(Button.B, () => {
|
||||
```
|
||||
|
||||
|
||||
### Challenge 3
|
||||
## Challenge 3
|
||||
|
||||
Add an event handler with `on shake` to change the LED brightness back to a `255`.
|
||||
|
@ -42,7 +42,7 @@ basic.forever(() => {
|
||||
|
||||
```
|
||||
|
||||
### Challenge 1
|
||||
## Challenge 1
|
||||
|
||||
What if wanted to show the maximum connectivity of wifi instead of just 1, 3, or 4 bars?
|
||||
|
||||
@ -86,7 +86,7 @@ basic.forever(() => {
|
||||
})
|
||||
```
|
||||
|
||||
### Challenge 2
|
||||
## Challenge 2
|
||||
|
||||
Let's add an **IF** at the bottom of your code that checks to see if `sum >= to 1200` **and** if `sum <1400`
|
||||
|
||||
@ -135,7 +135,7 @@ basic.forever(() => {
|
||||
})
|
||||
```
|
||||
|
||||
### Challenge 3
|
||||
## Challenge 3
|
||||
|
||||
Now it's your turn! Be creative and change the Wifi meter images to your own wifi image you're sure will prank your friends by editing the lines that call `showLeds()`.
|
||||
|
||||
|
@ -2,11 +2,11 @@
|
||||
|
||||
Rotate images with a while loop.
|
||||
|
||||
### ~avatar avatar
|
||||
## ~avatar avatar
|
||||
|
||||
Welcome! This tutorial will teach how to rotate images with a **while loop**. Let's get started!
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
Let's start by creating a global variable called `rotating` and initialize it to true. This well indicate when the animation should be displaying.
|
||||
|
||||
@ -61,9 +61,9 @@ while (rotating) {
|
||||
}
|
||||
```
|
||||
|
||||
### ~avatar avatar
|
||||
## ~avatar avatar
|
||||
|
||||
Excellent, you're ready to continue with the [challenges](/lessons/rotation-animation/challenges)!
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
|
@ -47,7 +47,7 @@ while (rotating) {
|
||||
```
|
||||
|
||||
|
||||
### Challenge 1
|
||||
## Challenge 1
|
||||
|
||||
Now let's add to this by creating a condition for on button pressed `A` before the while loop. We will also introduce serial writeLine for the while loop and input OnButtonPressed
|
||||
|
||||
@ -91,7 +91,7 @@ input.onButtonPressed(Button.A, () => {
|
||||
|
||||
```
|
||||
|
||||
### Challenge 2
|
||||
## Challenge 2
|
||||
|
||||
|
||||
|
||||
@ -139,7 +139,7 @@ input.onButtonPressed(Button.A, () => {
|
||||
|
||||
* Run the code to see the awesome rotation.
|
||||
|
||||
### Challenge 3
|
||||
## Challenge 3
|
||||
|
||||
Let's also make the image rotate the opposite way when button A is pressed! We can do this with another while loop that is only executed while `not rotating`.
|
||||
|
||||
|
@ -2,13 +2,13 @@
|
||||
|
||||
Clear the screen by pressing buttons on the @boardname@
|
||||
|
||||
### ~avatar avatar
|
||||
## ~avatar avatar
|
||||
|
||||
|
||||
|
||||
This activity will teach how to clear the screen by pressing button A on the @boardname@.
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
You can use the clear screen` function to turn off all the LED on the screen. Let's illustrate this concept with a small script where the user has to press the button A to turn off the screen. Let's start by adding the code to show an animation.
|
||||
|
||||
@ -82,9 +82,9 @@ input.onButtonPressed(Button.A, () => {
|
||||
|
||||
*Run* the script in the simulator or on the @boardname@ to see how this works!
|
||||
|
||||
### ~avatar boothing
|
||||
## ~avatar boothing
|
||||
|
||||
Excellent, you're ready to continue with the [challenges](/lessons/screen-wipe/challenges)!
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
|
@ -41,7 +41,7 @@ input.onButtonPressed(Button.A, () => {
|
||||
|
||||
```
|
||||
|
||||
### Challenge 1
|
||||
## Challenge 1
|
||||
|
||||
Create an event handler for Button B.
|
||||
|
||||
@ -83,7 +83,7 @@ input.onButtonPressed(Button.B, () => {
|
||||
|
||||
```
|
||||
|
||||
### Challenge 2
|
||||
## Challenge 2
|
||||
|
||||
|
||||
|
||||
@ -155,7 +155,7 @@ basic.showLeds(`
|
||||
```
|
||||
|
||||
|
||||
### Challenge 3
|
||||
## Challenge 3
|
||||
|
||||
Show an animation that scrolls back up when you press button "B".
|
||||
|
||||
|
@ -2,11 +2,11 @@
|
||||
|
||||
Welcome! In this project, you will build your own seismograph. This activity will teach how to use the @boardname@ to chart the strength of the acceleration. Let's get started! Project duration: 25 minutes.
|
||||
|
||||
### ~avatar avatar
|
||||
## ~avatar avatar
|
||||
|
||||
Engineering: In this project, you will build your own seismograph @boardname@ from tape and a household plate.
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
## What you'll need:
|
||||
|
||||
@ -32,11 +32,11 @@ Fasten Tape: Fasten tape to the micro USB cable and to the plate. Attach the @bo
|
||||
|
||||

|
||||
|
||||
### ~avatar avatar
|
||||
## ~avatar avatar
|
||||
|
||||
Computer Science: The seismograph has been built. We are ready to program the @boardname@ to be a seismograph!
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
# Programming Steps
|
||||
|
||||
@ -70,13 +70,13 @@ basic.forever(() => {
|
||||
|
||||
```
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
### ~avatar avatar
|
||||
## ~avatar avatar
|
||||
|
||||
Data Analysis: We now need to use the @boardname@ to Analyze Data and chart for the strength of the acceleration.
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
# Data Analysis Steps
|
||||
|
||||
@ -178,9 +178,9 @@ Let's select Style 10 as an example.
|
||||
|
||||

|
||||
|
||||
### ~avatar avatar
|
||||
## ~avatar avatar
|
||||
|
||||
Excellent, you're ready to continue with the [challenges](/lessons/seismograph/challenge)
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
|
@ -3,11 +3,11 @@
|
||||
Coding challenges for the seismograph.
|
||||
|
||||
|
||||
### ~avatar avatar
|
||||
## ~avatar avatar
|
||||
|
||||
Engineering: In this project, you will build a remote control based on the seismograph @boardname@ activity using a second @boardname@ and micro USB cable.
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
## What you'll need:
|
||||
|
||||
@ -30,9 +30,9 @@ basic.forever(() => {
|
||||
|
||||
```
|
||||
|
||||
### ~avatar avatar
|
||||
## ~avatar avatar
|
||||
Computer Science: Welcome! The activity will teach you how to code the acceleration of the 1st @boardname@ and to visualize the acceleration on the 2nd @boardname@. Let's get started!
|
||||
### ~
|
||||
## ~
|
||||
|
||||
# Computer Science Steps
|
||||
|
||||
@ -97,9 +97,9 @@ radio.onDataPacketReceived(({ receivedNumber }) => {
|
||||
});
|
||||
```
|
||||
|
||||
### ~avatar avatar
|
||||
## ~avatar avatar
|
||||
Science: Welcome! The activity will teach you how to chart the acceleration of the 1st @boardname@ and to visualize the acceleration on the 2nd @boardname@. Let's get started!
|
||||
### ~
|
||||
## ~
|
||||
|
||||
# Science Steps
|
||||
|
||||
@ -190,7 +190,7 @@ Let's select Style 10 as an example.
|
||||

|
||||
|
||||
|
||||
### ~
|
||||
## ~
|
||||
* Have fun reviewing your seismograph data and analyzing the acceleration with Excel.
|
||||
* The first person and second person take shaking or moving the micor:bit in any direction while the other player charts the data on the @boardname@!
|
||||
* Review and analyze the actual @boardname@ device acceleration data on Excel
|
||||
|
@ -19,8 +19,8 @@ Learn how to **show LEDs** to turn on a LED light pattern on the LED screen. We
|
||||
|
||||
## Documentation
|
||||
|
||||
* **show LEDs** : [read more...](/reference/basic/show-leds)
|
||||
* **on button pressed** : [read more...](/reference/input/on-button-pressed)
|
||||
* **[show LEDs](/reference/basic/show-leds)**
|
||||
* **[on button pressed](/reference/input/on-button-pressed)**
|
||||
|
||||
```cards
|
||||
input.onButtonPressed(Button.A, () => {})
|
||||
|
@ -2,13 +2,13 @@
|
||||
|
||||
Learn to design a blinking image.
|
||||
|
||||
### ~avatar avatar
|
||||
## ~avatar avatar
|
||||
|
||||
|
||||
|
||||
Welcome! This tutorial will help you make a smiley face blink. Let's get started!
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
Create an animation with an image displaying a smiley face and the next image with no LEDs lit up. This will make it look like the smiley face is blinking as the display switches between images.
|
||||
|
||||
@ -29,9 +29,9 @@ basic.showLeds(`
|
||||
`)
|
||||
```
|
||||
|
||||
### ~avatar boothing
|
||||
## ~avatar boothing
|
||||
|
||||
Excellent, you're ready to continue with the [challenges](/lessons/smiley/challenges)!
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
|
@ -25,7 +25,7 @@ basic.showLeds(`
|
||||
```
|
||||
|
||||
|
||||
### Challenge 1
|
||||
## Challenge 1
|
||||
|
||||
What if we want to make the face to frown on button pressed A?
|
||||
|
||||
@ -52,7 +52,7 @@ input.onButtonPressed(Button.A, () => {
|
||||
})
|
||||
```
|
||||
|
||||
### Challenge 2
|
||||
## Challenge 2
|
||||
|
||||
|
||||
|
||||
@ -87,7 +87,7 @@ input.onButtonPressed(Button.A, () => {
|
||||
|
||||
* Run your code to see if it works as expected.
|
||||
|
||||
### Challenge 3
|
||||
## Challenge 3
|
||||
|
||||
When *button B* is pressed, let's change the sad face back to a happy face. To do this, begin by adding a condition for `on button pressed` *B*. Next, show LEDs as a smiley face inside the condition.
|
||||
|
||||
|
@ -2,13 +2,13 @@
|
||||
|
||||
design a blinking rectangle animation.
|
||||
|
||||
### ~avatar avatar
|
||||
## ~avatar avatar
|
||||
|
||||
|
||||
|
||||
Welcome! This tutorial will teach how design a **snowfall animation**. Let's get started!
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
Let's start by creating a `forever` loop that will allow us to repeat the show LEDs code. Any code in the `forever` loop will repeat in the background... forever.
|
||||
|
||||
@ -55,9 +55,9 @@ basic.forever(() => {
|
||||
|
||||
Run your code in the simulator or download it to your @boardname@ to see what happens!
|
||||
|
||||
### ~avatar avatar
|
||||
## ~avatar avatar
|
||||
|
||||
Excellent, you're ready to continue with the [challenges](/lessons/snowflake-fall/challenges)!
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
|
@ -25,7 +25,7 @@ basic.forever(() => {
|
||||
})
|
||||
```
|
||||
|
||||
### Challenge 1
|
||||
## Challenge 1
|
||||
|
||||
|
||||
|
||||
@ -62,7 +62,7 @@ basic.forever(() => {
|
||||
|
||||
* Run your program and see if it works.
|
||||
|
||||
### Challenge 3
|
||||
## Challenge 3
|
||||
|
||||
Add a fourth frame to the current animation... or make it your own!
|
||||
|
||||
|
@ -21,12 +21,12 @@ Learn how to declare a **Boolean** variable, `var t:= true` `var f:=false` for o
|
||||
|
||||
## Documentation
|
||||
|
||||
* **running time** : [read more...](/reference/input/running-time)
|
||||
* **variable** : [read more...](/blocks/variables)
|
||||
* **Boolean** : [read more...](/blocks/logic/boolean)
|
||||
* **on button pressed** : [read more...](/reference/input/on-button-pressed)
|
||||
* **if** : [read more...](/blocks/logic/if)
|
||||
* **show string** : [read more...](/reference/basic/show-string)
|
||||
* **[running time](/reference/input/running-time)**
|
||||
* **[variable](/blocks/variables)**
|
||||
* **[Boolean](/blocks/logic/boolean)** :
|
||||
* **[on button pressed](/reference/input/on-button-pressed)**
|
||||
* **[if](/blocks/logic/if)**
|
||||
* **[show string](/reference/basic/show-string)**
|
||||
|
||||
## Objectives
|
||||
|
||||
|
@ -16,7 +16,7 @@ input.onButtonPressed(Button.A, () => {
|
||||
})
|
||||
```
|
||||
|
||||
### Challenge 1
|
||||
## Challenge 1
|
||||
|
||||
We need to know when the user has hit button `A` 15 times. The user wins when he/she is able to accomplish this in less than 5000 milliseconds (5 seconds). We can check for both conditions by using an `and` operator. When using an `and` operator, both conditions need to be true in order for the condition to be true.
|
||||
|
||||
@ -43,7 +43,7 @@ input.onButtonPressed(Button.A, () => {
|
||||
})
|
||||
```
|
||||
|
||||
### Challenge 2
|
||||
## Challenge 2
|
||||
|
||||
We want to set `fastPress` to false if the user was too slow. To do so, we need another condition to see if the user took more than 5000 milliseconds (5 seconds). In the `if` statement, set `fastPress` to false.
|
||||
|
||||
@ -61,7 +61,7 @@ input.onButtonPressed(Button.A, () => {
|
||||
})
|
||||
```
|
||||
|
||||
### Challenge 3
|
||||
## Challenge 3
|
||||
|
||||
|
||||
|
||||
@ -89,7 +89,7 @@ input.onButtonPressed(Button.A, () => {
|
||||
|
||||
* Click the `run` button to see if the code runs properly.
|
||||
|
||||
### Challenge 4
|
||||
## Challenge 4
|
||||
|
||||
|
||||
|
||||
|
@ -2,11 +2,11 @@
|
||||
|
||||
Create an arrow that randomly points to a player.
|
||||
|
||||
### ~avatar avatar
|
||||
## ~avatar avatar
|
||||
|
||||
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
Welcome! This guided tutorial will teach how to program a script that randomly points to a player. Let's get started!
|
||||
|
||||
@ -102,9 +102,9 @@ input.onGesture(Gesture.Shake, () => {
|
||||
```
|
||||
|
||||
|
||||
### ~avatar avatar
|
||||
## ~avatar avatar
|
||||
|
||||
Excellent, you're ready to continue with the [challenges](/lessons/spinner/challenges)!
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
|
@ -40,7 +40,7 @@ input.onGesture(Gesture.Shake, () => {
|
||||
})
|
||||
```
|
||||
|
||||
### Challenge 1
|
||||
## Challenge 1
|
||||
|
||||
Modify the random number generator so that it can include new arrows we will create in the next challenge.
|
||||
|
||||
@ -82,7 +82,7 @@ input.onGesture(Gesture.Shake, () => {
|
||||
|
||||
* Do **not** run the code yet because it will not work until you have conditions for every random number.
|
||||
|
||||
### Challenge 2
|
||||
## Challenge 2
|
||||
|
||||
Let's add more arrows that point diagonally.
|
||||
|
||||
@ -167,7 +167,7 @@ input.onGesture(Gesture.Shake, () => {
|
||||
|
||||
* Run your code to see if it works as expected
|
||||
|
||||
### Challenge 3
|
||||
## Challenge 3
|
||||
|
||||
Add some other arrows if there are more than 8 players.
|
||||
|
||||
|
@ -2,9 +2,9 @@
|
||||
|
||||
Overview of Blocks lessons for the @boardname@.
|
||||
|
||||
### @short Lessons
|
||||
## @short Lessons
|
||||
|
||||
### ~column
|
||||
## ~column
|
||||
|
||||
## Science
|
||||
|
||||
@ -15,9 +15,9 @@ Overview of Blocks lessons for the @boardname@.
|
||||
* [Zoomer](/lessons/zoomer), measure the force with acceleration
|
||||
* [Glowing pendulum](/lessons/glowing-pendulum), construct a pendulum that glows using acceleration
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
### ~column
|
||||
## ~column
|
||||
|
||||
## Technology
|
||||
|
||||
@ -32,9 +32,9 @@ Overview of Blocks lessons for the @boardname@.
|
||||
* [Happy birthday](/lessons/happy-birthday), create a popular song
|
||||
* [Magic 8](/lessons/magic-8), a fortune teller game with the @boardname@
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
### ~column
|
||||
## ~column
|
||||
|
||||
## Engineering
|
||||
|
||||
@ -44,9 +44,9 @@ Overview of Blocks lessons for the @boardname@.
|
||||
* [Beatbox](/lessons/classic-beatbox), make a beatbox music player with variables
|
||||
* [Temperature](/lessons/temperature), get the ambient temperature (degree Celsius °C)
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
### ~column
|
||||
## ~column
|
||||
|
||||
## Math
|
||||
|
||||
@ -60,5 +60,5 @@ Overview of Blocks lessons for the @boardname@.
|
||||
* [Digi Yoyo](/lessons/digi-yoyo), create a counter with a while loop
|
||||
* [Rotation animation](/lessons/rotation-animation), control an animation with a boolean variable
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
|
@ -2,13 +2,13 @@
|
||||
|
||||
Develop shapes with a for loop.
|
||||
|
||||
### ~avatar avatar
|
||||
## ~avatar avatar
|
||||
|
||||
|
||||
|
||||
Welcome! This guided tutorial will teach how to develop shapes with a for loop. Let's get started!
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
Create a `for loop` that will loop from 0 to 4 to indicate the x-coordinates of the @boardname@ display.
|
||||
|
||||
@ -54,9 +54,9 @@ for (let i = 0; i < 5; i++) {
|
||||
}
|
||||
```
|
||||
|
||||
### ~avatar avatar
|
||||
## ~avatar avatar
|
||||
|
||||
Excellent, you're ready to continue with the [challenges](/lessons/strobe-light/challenges)!
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
|
@ -17,7 +17,7 @@ for (let i = 0; i < 5; i++) {
|
||||
```
|
||||
|
||||
|
||||
### Challenge 1
|
||||
## Challenge 1
|
||||
|
||||
|
||||
|
||||
@ -34,7 +34,7 @@ for (let i = 0; i < 5; i++) {
|
||||
|
||||
* Run the code to see if it works as expected.
|
||||
|
||||
### Challenge 2
|
||||
## Challenge 2
|
||||
|
||||
|
||||
|
||||
@ -51,7 +51,7 @@ for (let i = 0; i < 5; i++) {
|
||||
|
||||
* Run the code to see if it works as expected.
|
||||
|
||||
### Challenge 3
|
||||
## Challenge 3
|
||||
|
||||
|
||||
|
||||
|
@ -2,11 +2,11 @@
|
||||
|
||||
Overview of lesson instructions for the @boardname@.
|
||||
|
||||
### @short Teach
|
||||
## @short Teach
|
||||
|
||||
The [lessons](/lessons) promote computational thinking and computer science literacy from an early age and provide opportunities for learning these skills within the context of public and private education, where they will be available to Year 7 students. This page is a 'how to manual' for using the lessons in the classroom.
|
||||
|
||||
### @section full
|
||||
## @section full
|
||||
|
||||
## Summary
|
||||
|
||||
|
@ -32,9 +32,9 @@ input.onGesture(Gesture.Shake, () => {
|
||||
|
||||
* click run to see if the code works as expected.
|
||||
|
||||
### ~avatar avatar
|
||||
## ~avatar avatar
|
||||
|
||||
Excellent, you're ready to continue with the [challenges](/lessons/temperature/challenges)!
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
|
@ -13,7 +13,7 @@ input.onGesture(Gesture.Shake, () => {
|
||||
})
|
||||
```
|
||||
|
||||
### Challenge 1
|
||||
## Challenge 1
|
||||
|
||||
Let's add the code to display the text `C IS THE TEMP` with a `show string` block. Modify the `show string` block to slowly display the text by an interval of `300`.
|
||||
|
||||
@ -27,7 +27,7 @@ input.onGesture(Gesture.Shake, () => {
|
||||
|
||||
* Run the code to see if it works as expected.
|
||||
|
||||
### Challenge 2
|
||||
## Challenge 2
|
||||
|
||||
Let's add code to display the temperature gauge image with a `show LEDs` block.
|
||||
|
||||
|
@ -2,13 +2,13 @@
|
||||
|
||||
A multi-player game that forces each player to reveal a secret or something funny.
|
||||
|
||||
### ~avatar avatar
|
||||
## ~avatar avatar
|
||||
|
||||
|
||||
|
||||
Welcome! This tutorial will teach how to program a game of truth or dare on the @boardname@. Let's get started!
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
Begin by using Show LEDs to create an "up-arrow" image, which will point to someone.
|
||||
|
||||
@ -90,9 +90,9 @@ input.onButtonPressed(Button.A, () => {
|
||||
|
||||
* Run your program: Press button A!
|
||||
|
||||
### ~avatar avatar
|
||||
## ~avatar avatar
|
||||
|
||||
Excellent, you're ready to continue with the [challenges](/lessons/truth-or-dare/challenges)!
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
|
@ -32,7 +32,7 @@ input.onButtonPressed(Button.A, () => {
|
||||
})
|
||||
```
|
||||
|
||||
### Challenge 1
|
||||
## Challenge 1
|
||||
|
||||
Let's make the word "DARE" appear a little more often than "TRUTH". Change the line of code with `pick random (1)` to `pick random (2)`.
|
||||
|
||||
@ -62,7 +62,7 @@ input.onButtonPressed(Button.A, () => {
|
||||
```
|
||||
|
||||
|
||||
### Challenge 2
|
||||
## Challenge 2
|
||||
|
||||
Instead of just saying "TRUTH" or "DARE", let's sometimes say "SKIP". This would allow the skipped person to spin the @boardname@ without completing a truth or dare. Modify the if statement as shown.
|
||||
|
||||
@ -98,7 +98,7 @@ input.onButtonPressed(Button.A, () => {
|
||||
|
||||
* Run your code to see if it works as expected
|
||||
|
||||
### Challenge 3
|
||||
## Challenge 3
|
||||
|
||||
Add some other messages, such as "TWO DARES" for the @boardname@ to show. You will need to modify the parameter inside `pick random (3)` as well as adding another `if` condition.
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
# truth or dare tutorial
|
||||
|
||||
### ~avatar avatar
|
||||
## ~avatar avatar
|
||||
|
||||
|
||||
|
||||
@ -8,9 +8,9 @@ The *Truth or dare!* game works as follows: a player spins the @boardname@ on th
|
||||
When the @boardname@ stops spinning, the player pointed by the arrow (displayed on screen) must press the button "A"
|
||||
to see if she has to provide a *truth* or a *dare*.
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
### Rebuild the game!
|
||||
## Rebuild the game!
|
||||
|
||||
The blocks have been shuffled! Put them back together so that...
|
||||
* an up arrow is displayed when the @boardname@ is powered on.
|
||||
@ -42,7 +42,7 @@ input.onButtonPressed(Button.A, () => {
|
||||
`)
|
||||
})
|
||||
```
|
||||
### Hints and tips
|
||||
## Hints and tips
|
||||
Cut out these documentation cards to help you!
|
||||
|
||||
```cards
|
||||
|
@ -26,7 +26,7 @@ Drag another `set item` block from the **Variables** draw and click the **down a
|
||||
|
||||
Finally, beneath that line, drag a `show number` block from the **Basic** drawer, and drag out the `0`. Drag another variable block from the **Variables** drawer, change it to `value`, and drop this into the space.
|
||||
|
||||
### What does this code do?
|
||||
## What does this code do?
|
||||
|
||||
* We create a new variable called value and set it to 0
|
||||
* The code runs forever and waits for the user to press the A button
|
||||
|
@ -2,11 +2,11 @@
|
||||
|
||||
Measure the acceleration on the @boardname@ in the "z" direction.
|
||||
|
||||
### ~avatar avatar
|
||||
## ~avatar avatar
|
||||
|
||||
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
Welcome! This activity will teach how to measure the acceleration on the @boardname@ in the "z" direction. Let's get started!
|
||||
|
||||
@ -35,9 +35,9 @@ basic.forever(() => {
|
||||
})
|
||||
```
|
||||
|
||||
### ~avatar avatar
|
||||
## ~avatar avatar
|
||||
|
||||
Excellent, you're ready to continue with the [challenges](/lessons/zoomer/challenges)!
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
|
@ -12,7 +12,7 @@ basic.forever(() => {
|
||||
basic.showNumber(az)
|
||||
})
|
||||
```
|
||||
### Challenge 1
|
||||
## Challenge 1
|
||||
|
||||
|
||||
|
||||
@ -31,7 +31,7 @@ basic.forever(() => {
|
||||
|
||||
* Run the code to see if it works as expected.
|
||||
|
||||
### Challenge 2
|
||||
## Challenge 2
|
||||
|
||||
Display the `y` acceleration when `B` is pressed by adding another `if` statement using `button (B) is pressed`.
|
||||
|
||||
|
Reference in New Issue
Block a user