inserting macros instead of hard coded board names

This commit is contained in:
Peli de Halleux
2016-11-01 10:42:42 -07:00
parent 6799721c9b
commit d76d92e041
132 changed files with 271 additions and 271 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
# answering machine blocks lesson
Create an answering machine on the BBC micro:bit
Create an answering machine on the @boardname@
## Topic
+2 -2
View File
@@ -1,6 +1,6 @@
# beautiful image lesson
Display beautiful images on the BBC micro:bit.
Display beautiful images on the @boardname@.
## Topic
@@ -14,7 +14,7 @@ Show LEDs
## Prior learning/place of lesson in scheme of work
Learn how to **show LEDs**, to show an image on the BBC micro:bit's LED screen. We will be learning how to Show LEDs using simple commands such as Show LEDs and pause.
Learn how to **show LEDs**, to show an image on the @boardname@'s LED screen. We will be learning how to Show LEDs using simple commands such as Show LEDs and pause.
## Documentation
+6 -6
View File
@@ -4,19 +4,19 @@ An introduction to conditions for the Block Editor.
## Introduction to conditions
In the introduction to code, we made the BBC micro:bit automatically shows the message hello world!:
In the introduction to code, we made the @boardname@ automatically shows the message hello world!:
```blocks
basic.showString("hello world!")
```
This statement, or code, will happen as soon as the BBC micro:bit is activated. This means it is unconditional. We can add a condition to make code function in certain ways:
This statement, or code, will happen as soon as the @boardname@ is activated. This means it is unconditional. We can add a condition to make code function in certain ways:
* A calculator waits for the user in input numbers and a function, before outputting a result
* A game waits for the user to press a button at the right time before outputting their score
* A quiz waits for the user to choose the correct option, and if they are wrong the quiz will tell the user
In programming we use an if statement: if this condition is met, do something. Lets add an if statement to the code we had before; the BBC Micro:bit will wait for the user to press a button before showing the image.
In programming we use an if statement: if this condition is met, do something. Lets add an if statement to the code we had before; the @boardname@ will wait for the user to press a button before showing the image.
```blocks
basic.forever(() => {
@@ -40,9 +40,9 @@ You could now add additional conditions to your 'if statement'. Here are some id
What if the user does not press a button? What if the user presses the wrong button? We call this an else, because if the criteria of the if statement are not met then something else is done.
For example, we could make it so our BBC Micro:bit tells us to press the A button. Remove the `button pressed` and `show string` blocks from the `if` block and right click it and select **Delete**. Now click the **If** category and drag out an `else if` block. Plug the `button pressed` and `show string` blocks in the correct places.
For example, we could make it so our @boardname@ tells us to press the A button. Remove the `button pressed` and `show string` blocks from the `if` block and right click it and select **Delete**. Now click the **If** category and drag out an `else if` block. Plug the `button pressed` and `show string` blocks in the correct places.
We want the message "Press A!" to scroll across the BBC micro:bit, so right-click the `show string` block and select **Duplicate**. Drag this new block into the `else` section and replace the “hello, world!” with "Press A!". Your code should look like this:
We want the message "Press A!" to scroll across the @boardname@, so right-click the `show string` block and select **Duplicate**. Drag this new block into the `else` section and replace the “hello, world!” with "Press A!". Your code should look like this:
```blocks
basic.forever(() => {
@@ -54,7 +54,7 @@ basic.forever(() => {
})
```
So, to recap: the `forever` block makes sure our code runs forever. The BBC micro:bit checks if the user is pressing the left button, if the user is not then the “Press the button!” message will scroll across the LEDs. If the user is pressing the button then the “hello, world!” message will scroll across the screen. Check this in the simulator or attach the BBC micro:bit to the computer then click **Download** to send the code onto the BBC micro:bit.
So, to recap: the `forever` block makes sure our code runs forever. The @boardname@ checks if the user is pressing the left button, if the user is not then the “Press the button!” message will scroll across the LEDs. If the user is pressing the button then the “hello, world!” message will scroll across the screen. Check this in the simulator or attach the @boardname@ to the computer then click **Download** to send the code onto the @boardname@.
## What is a condition?
+1 -1
View File
@@ -1,6 +1,6 @@
# bop it challenges
a game similar to "Simon Says" with the BBC micro:bit.
a game similar to "Simon Says" with the @boardname@.
## Before we get started
+2 -2
View File
@@ -45,7 +45,7 @@ if (action == 1) {
}
```
## 5. Write the code that increments the score if the BBC micro:bit 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
```blocks
input.onLogoDown(() => {
@@ -65,7 +65,7 @@ if (action == 2) {
}
```
## 7. Write the code that increments the score if the BBC micro:bit 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
```blocks
input.onLogoDown(() => {
+2 -2
View File
@@ -26,7 +26,7 @@ Answer the questions while completing the tutorial. Pay attention to the dialogu
<br />
### 5. Write the code that increments the score if the BBC micro:bit 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 />
@@ -34,5 +34,5 @@ Answer the questions while completing the tutorial. Pay attention to the dialogu
<br />
### 7. Write the code that increments the score if the BBC micro:bit 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
+1 -1
View File
@@ -47,5 +47,5 @@ game.removeLife(1);
* learn how to return the larger of two numbers
* learn how to return a random number
* learn how to return the modulus
* learn how to show a number of the BBC micro:bit screen
* learn how to show a number of the @boardname@ screen
* learn how to pause your code for the specified number of milliseconds
@@ -43,7 +43,7 @@ eggY = eggY + 1
led.plot(eggX, eggY)
```
## 4. . Write the code that resets the egg after it has fallen past the bottom of the BBC micro:bit.
## 4. . Write the code that resets the egg after it has fallen past the bottom of the @boardname@.
<br/>
+1 -1
View File
@@ -24,7 +24,7 @@ Answer the questions while completing the tutorial. Pay attention to the dialogu
<br/>
## 4. Write the code that resets the egg after it has fallen past the bottom of the BBC micro:bit.
## 4. Write the code that resets the egg after it has fallen past the bottom of the @boardname@.
<br/>
+2 -2
View File
@@ -1,6 +1,6 @@
# classic beatbox
display beautiful images on the BBC micro:bit.
display beautiful images on the @boardname@.
## Topic
@@ -19,5 +19,5 @@ Learn how to make a beatbox music player using pins P1 and P2. We will be learni
## Objectives
* learn how to code music on the BBC micro:bit
* learn how to code music on the @boardname@
+2 -2
View File
@@ -1,6 +1,6 @@
# compass lesson
create a die on the BBC micro:bit.
create a die on the @boardname@.
## Topic
@@ -36,7 +36,7 @@ basic.showLeds(`
## Objectives
* learn how to run code when the BBC micro:bit is shaken, when running code in the web browser, moving the mouse quickly simulates shaking
* learn how to run code when the @boardname@ is shaken, when running code in the web browser, moving the mouse quickly simulates shaking
* learn how to create a local variable as a place where you can store and retrieve data
* learn how the assignment operator is used to declare a new local variable
* learn how to declare a new local variable or update the value of a variable
+1 -1
View File
@@ -27,7 +27,7 @@ basic.forever(() => {
### Challenge 1
Instead of displaying `N` when the BBC micro:bit is pointing North, display a star to indicate the north star.
Instead of displaying `N` when the @boardname@ is pointing North, display a star to indicate the north star.
```blocks
let degrees = 0;
+2 -2
View File
@@ -1,6 +1,6 @@
# counter quiz answers
Learn how to create a counter with the BBC micro:bit button.
Learn how to create a counter with the @boardname@ button.
This is the answer key for the [counter quiz](/lessons/counter/quiz).
@@ -48,7 +48,7 @@ input.onButtonPressed(Button.A, () => {
![](/static/mb/lessons/counter-2.png)
We included the code ``on button pressed("A")`` that runs each time the user presses A. The code increments `count` by `1`. We increase `count` by 1 whenever the user presses the button. So the third time the A button is pressed on the BBC micro:bit, the number 3 is displayed
We included the code ``on button pressed("A")`` that runs each time the user presses A. The code increments `count` by `1`. We increase `count` by 1 whenever the user presses the button. So the third time the A button is pressed on the @boardname@, the number 3 is displayed
<br/>
+1 -1
View File
@@ -1,6 +1,6 @@
# counter quiz
Learn how to create a counter with the BBC micro:bit button.
Learn how to create a counter with the @boardname@ button.
## Name
+2 -2
View File
@@ -1,6 +1,6 @@
# dice roll lesson
Create a dice on the BBC micro:bit.
Create a dice on the @boardname@.
## Topic
@@ -35,7 +35,7 @@ basic.showLeds(`
## Objectives
* learn how to run code when the BBC micro:bit is shaken, when running code in the web browser, moving the mouse quickly simulates shaking
* learn how to run code when the @boardname@ is shaken, when running code in the web browser, moving the mouse quickly simulates shaking
* learn how to create a local variable as a place where you can store and retrieve data
* learn how the assignment operator is used to declare a new local variable
* learn how to declare a new local variable or update the value of a variable
+2 -2
View File
@@ -121,7 +121,7 @@ input.onGesture(Gesture.Shake, () => {
### 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 BBC micro:bit.
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@.
```blocks
input.onGesture(Gesture.Shake, () => {
@@ -179,5 +179,5 @@ input.onGesture(Gesture.Shake, () => {
### Challenge 3
Add a couple more conditions so that the BBC micro:bit randomly chooses a number between 1 and 8.
Add a couple more conditions so that the @boardname@ randomly chooses a number between 1 and 8.
+1 -1
View File
@@ -1,6 +1,6 @@
# dice roll quiz answers
Create a dice when the BBC micro:bit is shaken
Create a dice when the @boardname@ is shaken
These are the answers to the [dice roll quiz](/lessons/dice-roll/quiz).
+1 -1
View File
@@ -1,6 +1,6 @@
# dice roll quiz
Create a dice when the BBC micro:bit is shaken
Create a dice when the @boardname@ is shaken
## Name
+1 -1
View File
@@ -1,6 +1,6 @@
# game of chance blocks lesson
create an answering machine on the BBC micro:bit
create an answering machine on the @boardname@
## Topic
@@ -33,7 +33,7 @@ let acceleration = input.acceleration(Dimension.X)
let accelerationAbsolute = Math.abs(acceleration)
```
## 4. Write the code to use the acceleration value from question 3 to set the brightness on the BBC micro:bit.
## 4. Write the code to use the acceleration value from question 3 to set the brightness on the @boardname@.
<br/>
+1 -1
View File
@@ -22,6 +22,6 @@ Answer the questions while completing the tutorial. Pay attention to the dialogu
<br/>
## 4. Write the code to include acceleration value question 3 to set the brightness on the BBC micro:bit.
## 4. Write the code to include acceleration value question 3 to set the brightness on the @boardname@.
+2 -2
View File
@@ -1,12 +1,12 @@
# glowing pendulum block tutorial
The glowing pendulum changes the screen brightness based on the acceleration measured on the BBC micro:bit.
The glowing pendulum changes the screen brightness based on the acceleration measured on the @boardname@.
### Rebuild the game!
The blocks have been shuffled! Put them back together so that...
* all LEDs are turned on
* the BBC micro:bit repeats code **forever** that
* the @boardname@ repeats code **forever** that
* reads the acceleration along the ``y`` axis,
* calculate the absolute value of the acceleration
* scales down the acceleration value by a factor of `4`
+5 -5
View File
@@ -4,13 +4,13 @@ An introduction to graphics for the Block Editor.
## Before we get started
Ensure you have completed the 'Hello, world!' and Loop tutorials and tested them on a simulator or on BBC micro:bit.
Ensure you have completed the 'Hello, world!' and Loop tutorials and tested them on a simulator or on @boardname@.
```blocks
basic.showString("HI!");
```
The BBC micro:bit has a grid of 25 LEDs, so we can use these to display images.
The @boardname@ has a grid of 25 LEDs, so we can use these to display images.
Weve 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.
@@ -22,7 +22,7 @@ We can draw little images from the LEDs by ticking boxes. Drag a `show image` bl
### 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 BBC micro:bit.
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@.
We can also unplot a point (turn the LED off again) using the `unplot` block. So we could create a flashing LED program, using the `pause` block to create a delay.
@@ -43,7 +43,7 @@ The pause block is in milliseconds, so setting it to 1000 will have a pause of a
### 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 BBC micro:bit using an algorithm.
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:
```blocks
@@ -70,7 +70,7 @@ basic.forever(() => {
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 BBC micro:bit display an explosion or fireworks.
We could create more complex animations, for example we could make our @boardname@ display an explosion or fireworks.
### Image variables
+1 -1
View File
@@ -16,7 +16,7 @@ Math - Pick Random
## Prior learning/place of lesson in scheme of work
Learn how to create numbers randomly by using the input of the BBC micro:bit. We will be learning how to create random numbers with input using a local variable as well as simple commands, such as pick number and show number.
Learn how to create numbers randomly by using the input of the @boardname@. We will be learning how to create random numbers with input using a local variable as well as simple commands, such as pick number and show number.
## Documentation
@@ -10,7 +10,7 @@ Answers may vary. Generally, on button pressed run code when an input button is
## 2. Consider the following directions
Write the line of code that creates a condition when the BBC micro:bit button A is pressed.
Write the line of code that creates a condition when the @boardname@ button A is pressed.
```blocks
@@ -28,7 +28,7 @@ let randomNumber = Math.random(10)
```
## 4.
If the rectangle below represents the BBC micro:bit, shade the areas that will be displayed. Explain why that particular area is shaded.
If the rectangle below represents the @boardname@, shade the areas that will be displayed. Explain why that particular area is shaded.
```blocks
let randomNumber = Math.random(10)
+4 -4
View File
@@ -1,6 +1,6 @@
# happy birthday blocks lesson
display beautiful images on the BBC micro:bit.
display beautiful images on the @boardname@.
## Topic
@@ -13,10 +13,10 @@ Music
## Prior learning/place of lesson in scheme of work
Learn how to convert your BBC micro:bit into a music player using pins P0 and GND, earphones (or speakers), as well as crocodile clips (or spring clips).
Learn how to convert your @boardname@ into a music player using pins P0 and GND, earphones (or speakers), as well as crocodile clips (or spring clips).
We will be learning how to code musical notes using simple commands such as play, keys, and notes.
## Objectives
* learn how to code music on the BBC micro:bit
* learn how to setup the BBC micro:bit as a music player
* learn how to code music on the @boardname@
* learn how to setup the @boardname@ as a music player
+3 -3
View File
@@ -61,10 +61,10 @@ Learn how to create a charades game with **collections**, ` create -> Collection
* learn how to create a global variable as a place where you can store data so that you can use it later in your code, accessible across functions and in nested code blocks
* learn how to repeat code in the background forever
* learn how to learn how to conditionally run code depending on whether a condition is true or not
* learn how to run code when the BBC micro:bit is oriented perpendicular to the floor with the logo down
* learn how to run code when the @boardname@ is oriented perpendicular to the floor with the logo down
* learn how to get the number of milliseconds elapsed since the script began
* learn how to show a string on the BBC micro:bit screen
* learn how to show a number of the BBC micro:bit screen
* learn how to show a string on the @boardname@ screen
* learn how to show a number of the @boardname@ screen
## Links to the National Curriculum Programmes of Study for Computing
+2 -2
View File
@@ -16,7 +16,7 @@ for (let i = 0; i < 4; i++) {
}
```
If the rectangle below represents the BBC micro:bit, shade the areas that will be displayed. Explain why that particular area is shaded.
If the rectangle below represents the @boardname@, shade the areas that will be displayed. Explain why that particular area is shaded.
Let's create a for loop where `0` is the loop's starting value, `i` is the index variable, and `4` is the ending value. The index variable `i` starts at 0 and increases by 1 each time through the loop. The loop ends when `i = 4`.
@@ -30,7 +30,7 @@ for (let i1 = 0; i1 < 6; i1++) {
}
```
If the rectangle below represents the BBC micro:bit, shade the areas that will be displayed. Explain why that particular area is shaded.
If the rectangle below represents the @boardname@, shade the areas that will be displayed. Explain why that particular area is shaded.
Let's create a for loop where `0` is the loop's starting value, `i` is the index variable, and `6` is the ending value. The index variable `i` starts at 0 and increases by 1 each time through the loop. The loop ends when `i = 6`.
+1 -1
View File
@@ -1,6 +1,6 @@
# love meter blocks lesson
Create a love meter with the BBC micro:bit.
Create a love meter with the @boardname@.
## Topic
+1 -1
View File
@@ -28,7 +28,7 @@ input.onPinPressed(TouchPin.P0, () => {
```
Finally, let's show that number on the micro:bit. You are registering an event handler that will execute on the BBC micro:bit whenever the user holds the GND pin with one hand, and presses pin 0 with the other hand, thus completing a circuit
Finally, let's show that number on the micro:bit. You are registering an event handler that will execute on the @boardname@ whenever the user holds the GND pin with one hand, and presses pin 0 with the other hand, thus completing a circuit
```blocks
+1 -1
View File
@@ -1,6 +1,6 @@
# magic 8 lesson
a fortune teller game with the BBC micro:bit.
a fortune teller game with the @boardname@.
## Topic
+1 -1
View File
@@ -1,6 +1,6 @@
# magic 8 quiz answers
create a magic 8 ball on the BBC micro:bit.
create a magic 8 ball on the @boardname@.
## Name
+1 -1
View File
@@ -1,6 +1,6 @@
# magic 8 quiz
create a magic 8 ball on the BBC micro:bit.
create a magic 8 ball on the @boardname@.
## Name
+2 -2
View File
@@ -12,11 +12,11 @@ Answer the questions while completing the tutorial. Pay attention to the dialogu
## 1. Define 'on logo up'
A function that will run code when the BBC micro:bit screen is facing up and vertically orientated.
A function that will run code when the @boardname@ screen is facing up and vertically orientated.
<br/>
## 2. Write the condition that detects when the BBC micro:bit logo is facing up and vertically orientated.
## 2. Write the condition that detects when the @boardname@ logo is facing up and vertically orientated.
The `logo up` event is raised when...
+2 -2
View File
@@ -12,9 +12,9 @@ Use the hints from the [magic logo activity](/lessons/magic-logo/activity) to an
<br/>
## 2. Write the condition that detects when the BBC micro:bit logo is facing up and vertically orientated.
## 2. Write the condition that detects when the @boardname@ logo is facing up and vertically orientated.
## 3. Write the code to display a downward pointing arrow when the BBC micro:bit logo is down.
## 3. Write the code to display a downward pointing arrow when the @boardname@ logo is down.
![](/static/mb/lessons/magic-logo-0.png)
+1 -1
View File
@@ -1,6 +1,6 @@
# night light lesson
change the brightness of the BBC micro:bit.
change the brightness of the @boardname@.
## Topic
+3 -3
View File
@@ -12,7 +12,7 @@ This function sets the brightness of the LED screen.
![](/static/mb/lessons/night-light-0.png)
If the rectangle above represents the BBC micro:bit, write the code to set all the LEDs to full brightness and to turn on all the LEDs.
If the rectangle above represents the @boardname@, write the code to set all the LEDs to full brightness and to turn on all the LEDs.
<br />
@@ -31,7 +31,7 @@ basic.showLeds(`
![](/static/mb/lessons/night-light-1.png)
If the rectangle above represents the BBC micro:bit, write the code to set the screen brightness to 50% (128) and turns on all the LEDs.
If the rectangle above represents the @boardname@, write the code to set the screen brightness to 50% (128) and turns on all the LEDs.
<br/>
@@ -50,7 +50,7 @@ basic.showLeds(`
![](/static/mb/lessons/night-light-2.png)
If the rectangle above represents the BBC micro:bit, write the code to turn off all the LEDs.
If the rectangle above represents the @boardname@, write the code to turn off all the LEDs.
```blocks
led.setBrightness(0)
+4 -4
View File
@@ -1,6 +1,6 @@
# night light quiz
change the brightness of the BBC micro:bit.
change the brightness of the @boardname@.
## Name
@@ -12,19 +12,19 @@ Answer the questions while completing the tutorial. Pay attention to the dialogu
## 1. Describe what "led->set brightness" does ?
## 2. If the picture below is the BBC micro:bit, write the code that sets all the LEDs to full brightness and turns on all the LEDs
## 2. If the picture below is the @boardname@, write the code that sets all the LEDs to full brightness and turns on all the LEDs
![](/static/mb/lessons/night-light-0.png)
<br />
## 3. If the picture below is the BBC micro:bit, write the code that sets the screen brightness to 50% (128) and turns on all the LEDs.
## 3. If the picture below is the @boardname@, write the code that sets the screen brightness to 50% (128) and turns on all the LEDs.
![](/static/mb/lessons/night-light-1.png)
<br/>
## 4. If the picture below is the BBC micro:bit, write the code turns off all the LEDs.
## 4. If the picture below is the @boardname@, write the code turns off all the LEDs.
![](/static/mb/lessons/night-light-2.png)
+3 -3
View File
@@ -21,7 +21,7 @@ basic.forever(() => {
})
```
The function `acceleration(y)` gets the acceleration value (milli g-force), in the `y` dimension. If the `acceleration(y)`is greater than 2000 milli g-force, we will change jumps by 1. If jumping is greater than 2000 milli-gravities, then change jumps by 1 and display a smiley on the BBC micro:bit. Finally, we will remove the smiley image from the screen
The function `acceleration(y)` gets the acceleration value (milli g-force), in the `y` dimension. If the `acceleration(y)`is greater than 2000 milli g-force, we will change jumps by 1. If jumping is greater than 2000 milli-gravities, then change jumps by 1 and display a smiley on the @boardname@. Finally, we will remove the smiley image from the screen
```blocks
@@ -42,7 +42,7 @@ basic.forever(() => {
})
```
Now let's register an event handler that will execute whenever an input button (A) is pressed during program execution. If you press button A, then show the number of jumps greater than 2000 milli-gravities on the BBC micro:bit.
Now let's register an event handler that will execute whenever an input button (A) is pressed during program execution. If you press button A, then show the number of jumps greater than 2000 milli-gravities on the @boardname@.
```blocks
let jumps = 0
@@ -65,7 +65,7 @@ input.onButtonPressed(Button.A, () => {
})
```
If you press button A+B together, then reset the jump counter to 0 on the BBC micro:bit. Finally, we will show the show the jump counter on the micro:bit
If you press button A+B together, then reset the jump counter to 0 on the @boardname@. Finally, we will show the show the jump counter on the micro:bit
```blocks
@@ -45,7 +45,7 @@ while (rotating) {
It is a **while** loop that will be executed only if the ** variable** called `rotating` is **true**.
## 4. If the rectangle below represents the BBC micro:bit, shade the areas that will be displayed. Explain why that particular area is shaded.
## 4. If the rectangle below represents the @boardname@, shade the areas that will be displayed. Explain why that particular area is shaded.
```blocks
basic.showLeds(`
+1 -1
View File
@@ -10,7 +10,7 @@ Engineering: In this project, you will build your own seismograph micro:bit from
## What you'll need:
* BBC micro:bit
* @boardname@
* micro USB cable
* Plate
* Tape
+1 -1
View File
@@ -11,7 +11,7 @@ Engineering: In this project, you will build a remote control based on the seism
## What you'll need:
* BBC micro:bits (2)
* @boardname@s (2)
* micro USB cables (2)
* Plate
* Tape
+1 -1
View File
@@ -53,7 +53,7 @@ basic.forever(() => {
})
```
Run your code in the simulator or download it to your BBC micro:bit to see what happens!
Run your code in the simulator or download it to your @boardname@ to see what happens!
### ~avatar avatar
+1 -1
View File
@@ -1,6 +1,6 @@
# speed button lesson
code a speed game by declaring Booleans on the BBC micro:bit.
code a speed game by declaring Booleans on the @boardname@.
+3 -3
View File
@@ -10,7 +10,7 @@ This is the answer key for the [speed button quiz](/lessons/speed-button/quiz).
A variable that is available throughout your main function.
## 2. If the rectangle below represents the BBC micro:bit, shade the area that shows the value of the variable count.
## 2. If the rectangle below represents the @boardname@, shade the area that shows the value of the variable count.
```blocks
let count = 0
@@ -18,7 +18,7 @@ let count = 0
![](/static/mb/lessons/speed-button-0.png)
## 3. If the rectangle below represents the BBC micro:bit, shade the areas that will be displayed after two button presses on Button A. Explain why that particular area is shaded.
## 3. If the rectangle below represents the @boardname@, shade the areas that will be displayed after two button presses on Button A. Explain why that particular area is shaded.
```blocks
let count = 0
@@ -34,7 +34,7 @@ input.onButtonPressed(Button.A, () => {
After two button presses, **count** will be equal to 2.
## 5. If the rectangle below represents the BBC micro:bit, shade the areas that will be displayed after five button presses on Button A. Explain why that particular area is shaded.
## 5. If the rectangle below represents the @boardname@, shade the areas that will be displayed after five button presses on Button A. Explain why that particular area is shaded.
```blocks
let count = 0
+2 -2
View File
@@ -1,6 +1,6 @@
# spinner lesson
a spin the BBC micro:bit game with the input on shake.
a spin the @boardname@ game with the input on shake.
@@ -37,7 +37,7 @@ basic.showLeds(`
## Objectives
* learn how to run code when the BBC micro:bit is shaken, when running code in the web browser, moving the mouse quickly simulates shaking
* learn how to run code when the @boardname@ is shaken, when running code in the web browser, moving the mouse quickly simulates shaking
* learn how to create a local variable as a place where you can store and retrieve data
* learn how the assignment operator is used to declare a new local variable
* learn how to declare a new local variable or update the value of a variable
+1 -1
View File
@@ -1,6 +1,6 @@
# spinner quiz answers
a spin the BBC micro:bit game with the input on shake.
a spin the @boardname@ game with the input on shake.
## Name
+1 -1
View File
@@ -1,6 +1,6 @@
# spinner quiz
a spin the BBC micro:bit game with the input on shake.
a spin the @boardname@ game with the input on shake.
## Name
+4 -4
View File
@@ -1,6 +1,6 @@
# Block Editor STEM Lessons
Overview of Blocks lessons for the BBC micro:bit.
Overview of Blocks lessons for the @boardname@.
### @short Lessons
@@ -9,9 +9,9 @@ Overview of Blocks lessons for the BBC micro:bit.
## Science
* [Night Light](/lessons/night-light), dim the LEDs with set brightness
* [Hack your headphones](/projects/hack-your-headphones), create music on the BBC micro:bit by hacking your headphones
* [Hack your headphones](/projects/hack-your-headphones), create music on the @boardname@ by hacking your headphones
* [Banana Keyboard](/projects/banana-keyboard), create music with fruits
* [Telegraph](/projects/telegraph), play the telegraph game between 2 BBC micro:bits
* [Telegraph](/projects/telegraph), play the telegraph game between 2 @boardname@s
* [Zoomer](/lessons/zoomer), measure the force with acceleration
* [Glowing pendulum](/lessons/glowing-pendulum), construct a pendulum that glows using acceleration
@@ -30,7 +30,7 @@ Overview of Blocks lessons for the BBC micro:bit.
* [Flashing heart](/lessons/flashing-heart), display images with a pause
* [Blink](/lessons/blink), turn an LED on and off with plot
* [Happy birthday](/lessons/happy-birthday), create a popular song
* [Magic 8](/lessons/magic-8), a fortune teller game with the BBC micro:bit
* [Magic 8](/lessons/magic-8), a fortune teller game with the @boardname@
### ~
+4 -4
View File
@@ -1,6 +1,6 @@
# Teach Blocks
Overview of lesson instructions for the BBC micro:bit.
Overview of lesson instructions for the @boardname@.
### @short Teach
@@ -34,7 +34,7 @@ The quiz answers provide responses to the quiz. This will allow teachers to accu
5) Challenges
After the student completes the quiz, tutorial, and compiles the code onto the BBC micro:bit, distribute the lessons challenges. Challenges are additional customizing and exercises for the students. Challenges reinforce the concepts followed in the tutorial and quiz responses as shown with the [blink challenges](/lessons/blink/challenges).
After the student completes the quiz, tutorial, and compiles the code onto the @boardname@, distribute the lessons challenges. Challenges are additional customizing and exercises for the students. Challenges reinforce the concepts followed in the tutorial and quiz responses as shown with the [blink challenges](/lessons/blink/challenges).
## Teacher Directions
@@ -48,7 +48,7 @@ After the student completes the quiz, tutorial, and compiles the code onto the B
5) Complete quiz questions by following the the guided tutorials
6) Compile the code from the tutorial onto the BBC micro:bit
6) Compile the code from the tutorial onto the @boardname@
7) Distribute the challenges for additional coding through paper instructions
@@ -66,7 +66,7 @@ After the student completes the quiz, tutorial, and compiles the code onto the B
``05:00`` Distribute Lesson Quiz
``07:00`` Access BBC micro:bit website
``07:00`` Access @boardname@ website
``10:00`` Start Lesson Activity & Lesson Quiz
+1 -1
View File
@@ -1,6 +1,6 @@
# temperature blocks lesson
measure the temperature on the BBC micro:bit.
measure the temperature on the @boardname@.
## Topic
+2 -2
View File
@@ -1,6 +1,6 @@
# truth or dare lesson
create a love meter with the BBC micro:bit.
create a love meter with the @boardname@.
@@ -39,7 +39,7 @@ basic.showString("Hello!")
## Objectives
* learn how to display an image on the BBC micro:bit
* learn how to display an image on the @boardname@
* learn how to run code when an input button is pressed
* learn how to a create a variable for a place where you can store and retrieve data
* learn how to declare a new local variable or update the value of a variable
+1 -1
View File
@@ -23,7 +23,7 @@ basic.showLeds(`
```
Now let's create a condition to know when button `A` is pressed so that we can display "truth" or "dare" on the micro:bit. We want the BBC micro:bit to randomly choose whether to display "truth" or display "dare". We can use accomplish this by using `pick random (1)`.
Now let's create a condition to know when button `A` is pressed so that we can display "truth" or "dare" on the micro:bit. We want the @boardname@ to randomly choose whether to display "truth" or display "dare". We can use accomplish this by using `pick random (1)`.
```blocks
basic.showLeds(`
+1 -1
View File
@@ -10,7 +10,7 @@ This is the answer key for the [truth or dare quiz](/lessons/truth-or-dare/quiz)
let random = Math.random(4)
```
## 2. Write an if statement that will display the message "TRUTH" on the BBC micro:bit if the local variable 'random' equals 0.
## 2. Write an if statement that will display the message "TRUTH" on the @boardname@ if the local variable 'random' equals 0.
```blocks
let random = Math.random(4)
+1 -1
View File
@@ -16,7 +16,7 @@ Answer the questions while completing the tutorial. Pay attention to the dialogu
<br/>
## 2. Write an if statement that will display the message "TRUTH" on the BBC micro:bit if the local variable 'random' equals 0.
## 2. Write an if statement that will display the message "TRUTH" on the @boardname@ if the local variable 'random' equals 0.
<br/>
+1 -1
View File
@@ -4,7 +4,7 @@
The *Truth or dare!* game works as follows: a player spins the BBC micro:bit on the table.
The *Truth or dare!* game works as follows: a player spins the @boardname@ on the table.
When the micro:bit 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*.
+2 -2
View File
@@ -4,7 +4,7 @@ An introduction to variables for the Block Editor.
## What is a variable?
Variables are things that are remembered by the BBC micro:bit. Variables can take a few formats and can have functions applied to them. For example, we could create a string, which is text. Or we could create a calculator that stores whichever number the user inputs as an integer, or whole number.
Variables are things that are remembered by the @boardname@. Variables can take a few formats and can have functions applied to them. For example, we could create a string, which is text. Or we could create a calculator that stores whichever number the user inputs as an integer, or whole number.
We can modify variables but they must first be defined. Open the Variables drawer to the left of your code.
@@ -31,7 +31,7 @@ Finally, beneath that line, drag a `show number` block from the **Basic** drawer
* 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
* When the user does, value will be set to value + 1 (value will be incremented by 1)
* Value will then be displayed on the BBC micro:bit's LEDS
* Value will then be displayed on the @boardname@'s LEDS
* This effectively creates a counter
Variables can also be used for conditions with loops. See the 'Loops' section to learn about this.
+2 -2
View File
@@ -6,7 +6,7 @@ This is the answer key for the [zoomer quiz](/lessons/zoomer/quiz).
## 1. What is 'acceleration'?
Acceleration is amount of force being applied to the BBC micro:bit in one of three specified directions.
Acceleration is amount of force being applied to the @boardname@ in one of three specified directions.
## 2. Consider the following directions
@@ -22,7 +22,7 @@ Note: acceleration does not have be measured in the "x" direction. It can also b
## 3. Consider the following directions
After storing the acceleration in a variable, write the code to show acceleration on the BBC micro:bit as a number
After storing the acceleration in a variable, write the code to show acceleration on the @boardname@ as a number
<br/>
+1 -1
View File
@@ -18,7 +18,7 @@ Answer the questions while completing the tutorial. Pay attention to the dialogu
<br/>
## 3. After storing the acceleration in a variable, write the code to show acceleration on the BBC micro:bit as a number.
## 3. After storing the acceleration in a variable, write the code to show acceleration on the @boardname@ as a number.
<br/>