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

View File

@ -8,10 +8,10 @@
* [Projects](/projects) * [Projects](/projects)
* [Lessons](/lessons) * [Lessons](/lessons)
### Micro:bit reference ### @boardname@ reference
* [The micro:bit APIs](/reference) * [The @boardname@ APIs](/reference)
* [The micro:bit device](/device) * [The @boardname@ device](/device)
### Language and data reference ### Language and data reference

View File

@ -35,7 +35,7 @@ When this program runs, you will see a smiley face, then a blank
screen, then a smiley again -- it never stops! (That's because of the screen, then a smiley again -- it never stops! (That's because of the
``forever`` block.) ``forever`` block.)
Click **Download** to move your program to the BBC micro:bit! Click **Download** to move your program to the @boardname@!
Make sure to follow the instructions. Make sure to follow the instructions.
### ~button /getting-started/screen ### ~button /getting-started/screen

View File

@ -18,11 +18,11 @@ input.onButtonPressed(Button.A, () => {
#### ~hint #### ~hint
The ``showString`` block can show letters, numbers, and punctuation The ``showString`` block can show letters, numbers, and punctuation
on the micro:bit screen. on the @boardname@ screen.
#### ~ #### ~
Now try to unscramble these blocks in the editor so that the micro:bit Now try to unscramble these blocks in the editor so that the @boardname@
shows **BANANA** when you press button `B`. shows **BANANA** when you press button `B`.
```shuffle ```shuffle
@ -37,7 +37,7 @@ You can find the letter `B` by clicking the letter `A` on the
#### ~ #### ~
Click **Download** to move your program to the BBC micro:bit! Click **Download** to move your program to the BBC @boardname@!
#### Your turn! #### Your turn!
@ -65,7 +65,7 @@ input.onPinPressed(TouchPin.P0, () => {
. . # . .`); . . # . .`);
}); });
``` ```
Click **Download** to move your program to the BBC micro:bit! Click **Download** to move your program to the @boardname@!
## ~hint ## ~hint

View File

@ -4,7 +4,7 @@
Are you trying to choose whether to play soccer or go to the movies Are you trying to choose whether to play soccer or go to the movies
instead, or which toppings to have on your pizza? Build a coin instead, or which toppings to have on your pizza? Build a coin
flipping machine with the BBC micro:bit to choose for you! flipping machine with the @boardname@ to choose for you!
### ~ ### ~

View File

@ -2,7 +2,7 @@
### ~avatar avatar ### ~avatar avatar
Build a Rock Paper Scissors game with the BBC micro:bit! You can play Build a Rock Paper Scissors game with the @boardname@! You can play
the game with a friend who has it on a micro:bit. You can also play the game with a friend who has it on a micro:bit. You can also play
it with friends who are just using their hands. (The game is built it with friends who are just using their hands. (The game is built
like a coin flipper, but with three choices instead of two.) like a coin flipper, but with three choices instead of two.)
@ -152,7 +152,7 @@ That's why you can use an ``else`` instead of an ``else if``.
Your game is ready! Your game is ready!
Click **Download** to move your program to the BBC micro:bit! Click **Download** to move your program to the @boardname@!
Have fun! Have fun!
@ -198,7 +198,7 @@ input.onButtonPressed(Button.B, () => {
basic.showNumber(game.score()) basic.showNumber(game.score())
}) })
``` ```
Click **Download** to move your program to the BBC micro:bit! Click **Download** to move your program to the @boardname@!
### ~button /projects ### ~button /projects
NEXT: PROJECTS! NEXT: PROJECTS!

View File

@ -32,7 +32,7 @@ basic.forever(() => {
`) `)
}); });
``` ```
Click **Download** to move your program to the BBC micro:bit! Click **Download** to move your program to the @boardname@!
### Your turn! ### Your turn!
@ -85,7 +85,7 @@ basic.forever(() => {
`) `)
}); });
``` ```
Click **Download** to move your program to the BBC micro:bit! Click **Download** to move your program to the @boardname@!
#### ~hint #### ~hint

View File

@ -1,6 +1,6 @@
# Shake # Shake
You can find when someone is shaking the BBC micro:bit by checking its You can find when someone is shaking the @boardname@ by checking its
**accelerometer** (it finds whether the micro:bit is speeding up or **accelerometer** (it finds whether the micro:bit is speeding up or
slowing down). slowing down).
@ -17,7 +17,7 @@ input.onGesture(Gesture.Shake, () => {
# . . . #`); # . . . #`);
}); });
``` ```
Click **Download** to move your program to the BBC micro:bit! Click **Download** to move your program to the @boardname@!
### ~button /getting-started/coin-flipper ### ~button /getting-started/coin-flipper
NEXT: COIN FLIPPER GAME NEXT: COIN FLIPPER GAME

View File

@ -28,7 +28,7 @@
## Intermediate ## Intermediate
* [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@
* [Guess the Number](/lessons/guess-the-number), guess a random number with pick number * [Guess the Number](/lessons/guess-the-number), guess a random number with pick number
* [Counter](/lessons/counter), display a number with a variable * [Counter](/lessons/counter), display a number with a variable
* [Love Meter](/lessons/love-meter), create a love meter with on pin pressed * [Love Meter](/lessons/love-meter), create a love meter with on pin pressed
@ -40,7 +40,7 @@
* [Temperature](/lessons/temperature), get the ambient temperature (degree Celsius °C) * [Temperature](/lessons/temperature), get the ambient temperature (degree Celsius °C)
* [Digi Yoyo](/lessons/digi-yoyo), create a counter with a while loop * [Digi Yoyo](/lessons/digi-yoyo), create a counter with a while loop
* [Rotation Animation](/lessons/rotation-animation), control an animation with a boolean variable * [Rotation Animation](/lessons/rotation-animation), control an animation with a boolean variable
* [Compass](/lessons/compass), displays the direction the BBC micro:bit is pointing with compass * [Compass](/lessons/compass), displays the direction the @boardname@ is pointing with compass
* [Zoomer](/lessons/zoomer), measure the force with acceleration * [Zoomer](/lessons/zoomer), measure the force with acceleration
* [Glowing Pendulum](/lessons/glowing-pendulum), construct a pendulum that glows using acceleration * [Glowing Pendulum](/lessons/glowing-pendulum), construct a pendulum that glows using acceleration
* [Classic Beatbox](/lessons/classic-beatbox), make a beatbox music player with variables * [Classic Beatbox](/lessons/classic-beatbox), make a beatbox music player with variables
@ -60,7 +60,7 @@
* [Prank WiFi](/lessons/prank-wifi), create fake WiFi to trick your friends * [Prank WiFi](/lessons/prank-wifi), create fake WiFi to trick your friends
* [Speed Button](/lessons/speed-button), code a speed game with running time * [Speed Button](/lessons/speed-button), code a speed game with running time
* [Headbands](/lessons/headbands), create a charades game with a collection of strings that hold the words * [Headbands](/lessons/headbands), create a charades game with a collection of strings that hold the words
* [Hero](/lessons/hero), reconstruct the classic arcade game pac man with the BBC micro:bit * [Hero](/lessons/hero), reconstruct the classic arcade game pac man with the @boardname@
* [Catch the Egg](/lessons/catch-the-egg-game), catch falling eggs in a basket with an acceleration controller * [Catch the Egg](/lessons/catch-the-egg-game), catch falling eggs in a basket with an acceleration controller
### ~ ### ~

View File

@ -1,6 +1,6 @@
# answering machine blocks lesson # answering machine blocks lesson
Create an answering machine on the BBC micro:bit Create an answering machine on the @boardname@
## Topic ## Topic

View File

@ -1,6 +1,6 @@
# beautiful image lesson # beautiful image lesson
Display beautiful images on the BBC micro:bit. Display beautiful images on the @boardname@.
## Topic ## Topic
@ -14,7 +14,7 @@ Show LEDs
## Prior learning/place of lesson in scheme of work ## 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 ## Documentation

View File

@ -4,19 +4,19 @@ An introduction to conditions for the Block Editor.
## Introduction to conditions ## 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 ```blocks
basic.showString("hello world!") 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 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 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 * 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 ```blocks
basic.forever(() => { 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. 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 ```blocks
basic.forever(() => { 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? ## What is a condition?

View File

@ -1,6 +1,6 @@
# bop it challenges # 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 ## Before we get started

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 ```blocks
input.onLogoDown(() => { 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 ```blocks
input.onLogoDown(() => { input.onLogoDown(() => {

View File

@ -26,7 +26,7 @@ Answer the questions while completing the tutorial. Pay attention to the dialogu
<br /> <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 /> <br />
@ -34,5 +34,5 @@ Answer the questions while completing the tutorial. Pay attention to the dialogu
<br /> <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

View File

@ -47,5 +47,5 @@ game.removeLife(1);
* learn how to return the larger of two numbers * learn how to return the larger of two numbers
* learn how to return a random number * learn how to return a random number
* learn how to return the modulus * 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 * learn how to pause your code for the specified number of milliseconds

View File

@ -43,7 +43,7 @@ eggY = eggY + 1
led.plot(eggX, eggY) 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/> <br/>

View File

@ -24,7 +24,7 @@ Answer the questions while completing the tutorial. Pay attention to the dialogu
<br/> <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/> <br/>

View File

@ -1,6 +1,6 @@
# classic beatbox # classic beatbox
display beautiful images on the BBC micro:bit. display beautiful images on the @boardname@.
## Topic ## Topic
@ -19,5 +19,5 @@ Learn how to make a beatbox music player using pins P1 and P2. We will be learni
## Objectives ## Objectives
* learn how to code music on the BBC micro:bit * learn how to code music on the @boardname@

View File

@ -1,6 +1,6 @@
# compass lesson # compass lesson
create a die on the BBC micro:bit. create a die on the @boardname@.
## Topic ## Topic
@ -36,7 +36,7 @@ basic.showLeds(`
## Objectives ## 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 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 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 * learn how to declare a new local variable or update the value of a variable

View File

@ -27,7 +27,7 @@ basic.forever(() => {
### Challenge 1 ### 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 ```blocks
let degrees = 0; let degrees = 0;

View File

@ -1,6 +1,6 @@
# counter quiz answers # 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). 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) ![](/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/> <br/>

View File

@ -1,6 +1,6 @@
# counter quiz # 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 ## Name

View File

@ -1,6 +1,6 @@
# dice roll lesson # dice roll lesson
Create a dice on the BBC micro:bit. Create a dice on the @boardname@.
## Topic ## Topic
@ -35,7 +35,7 @@ basic.showLeds(`
## Objectives ## 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 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 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 * learn how to declare a new local variable or update the value of a variable

View File

@ -121,7 +121,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 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 ```blocks
input.onGesture(Gesture.Shake, () => { input.onGesture(Gesture.Shake, () => {
@ -179,5 +179,5 @@ input.onGesture(Gesture.Shake, () => {
### Challenge 3 ### 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.

View File

@ -1,6 +1,6 @@
# dice roll quiz answers # 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). These are the answers to the [dice roll quiz](/lessons/dice-roll/quiz).

View File

@ -1,6 +1,6 @@
# dice roll quiz # dice roll quiz
Create a dice when the BBC micro:bit is shaken Create a dice when the @boardname@ is shaken
## Name ## Name

View File

@ -1,6 +1,6 @@
# game of chance blocks lesson # game of chance blocks lesson
create an answering machine on the BBC micro:bit create an answering machine on the @boardname@
## Topic ## Topic

View File

@ -33,7 +33,7 @@ let acceleration = input.acceleration(Dimension.X)
let accelerationAbsolute = Math.abs(acceleration) 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/> <br/>

View File

@ -22,6 +22,6 @@ Answer the questions while completing the tutorial. Pay attention to the dialogu
<br/> <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@.

View File

@ -1,12 +1,12 @@
# glowing pendulum block tutorial # 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! ### Rebuild the game!
The blocks have been shuffled! Put them back together so that... The blocks have been shuffled! Put them back together so that...
* all LEDs are turned on * 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, * reads the acceleration along the ``y`` axis,
* calculate the absolute value of the acceleration * calculate the absolute value of the acceleration
* scales down the acceleration value by a factor of `4` * scales down the acceleration value by a factor of `4`

View File

@ -4,13 +4,13 @@ An introduction to graphics for the Block Editor.
## Before we get started ## 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 ```blocks
basic.showString("HI!"); 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. 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 ### 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. 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 ### 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: For example, we could draw a straight line with this code:
```blocks ```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). 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 ### Image variables

View File

@ -16,7 +16,7 @@ Math - Pick Random
## Prior learning/place of lesson in scheme of work ## 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 ## Documentation

View File

@ -10,7 +10,7 @@ Answers may vary. Generally, on button pressed run code when an input button is
## 2. Consider the following directions ## 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 ```blocks
@ -28,7 +28,7 @@ let randomNumber = Math.random(10)
``` ```
## 4. ## 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 ```blocks
let randomNumber = Math.random(10) let randomNumber = Math.random(10)

View File

@ -1,6 +1,6 @@
# happy birthday blocks lesson # happy birthday blocks lesson
display beautiful images on the BBC micro:bit. display beautiful images on the @boardname@.
## Topic ## Topic
@ -13,10 +13,10 @@ Music
## Prior learning/place of lesson in scheme of work ## 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. We will be learning how to code musical notes using simple commands such as play, keys, and notes.
## Objectives ## Objectives
* learn how to code music on the BBC micro:bit * learn how to code music on the @boardname@
* learn how to setup the BBC micro:bit as a music player * learn how to setup the @boardname@ as a music player

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 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 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 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 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 string on the @boardname@ screen
* learn how to show a number of the BBC micro:bit screen * learn how to show a number of the @boardname@ screen
## Links to the National Curriculum Programmes of Study for Computing ## Links to the National Curriculum Programmes of Study for Computing

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`. 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`. 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`.

View File

@ -1,6 +1,6 @@
# love meter blocks lesson # love meter blocks lesson
Create a love meter with the BBC micro:bit. Create a love meter with the @boardname@.
## Topic ## Topic

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 ```blocks

View File

@ -1,6 +1,6 @@
# magic 8 lesson # magic 8 lesson
a fortune teller game with the BBC micro:bit. a fortune teller game with the @boardname@.
## Topic ## Topic

View File

@ -1,6 +1,6 @@
# magic 8 quiz answers # magic 8 quiz answers
create a magic 8 ball on the BBC micro:bit. create a magic 8 ball on the @boardname@.
## Name ## Name

View File

@ -1,6 +1,6 @@
# magic 8 quiz # magic 8 quiz
create a magic 8 ball on the BBC micro:bit. create a magic 8 ball on the @boardname@.
## Name ## Name

View File

@ -12,11 +12,11 @@ Answer the questions while completing the tutorial. Pay attention to the dialogu
## 1. Define 'on logo up' ## 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/> <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... The `logo up` event is raised when...

View File

@ -12,9 +12,9 @@ Use the hints from the [magic logo activity](/lessons/magic-logo/activity) to an
<br/> <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) ![](/static/mb/lessons/magic-logo-0.png)

View File

@ -1,6 +1,6 @@
# night light lesson # night light lesson
change the brightness of the BBC micro:bit. change the brightness of the @boardname@.
## Topic ## Topic

View File

@ -12,7 +12,7 @@ This function sets the brightness of the LED screen.
![](/static/mb/lessons/night-light-0.png) ![](/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 /> <br />
@ -31,7 +31,7 @@ basic.showLeds(`
![](/static/mb/lessons/night-light-1.png) ![](/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/> <br/>
@ -50,7 +50,7 @@ basic.showLeds(`
![](/static/mb/lessons/night-light-2.png) ![](/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 ```blocks
led.setBrightness(0) led.setBrightness(0)

View File

@ -1,6 +1,6 @@
# night light quiz # night light quiz
change the brightness of the BBC micro:bit. change the brightness of the @boardname@.
## Name ## Name
@ -12,19 +12,19 @@ Answer the questions while completing the tutorial. Pay attention to the dialogu
## 1. Describe what "led->set brightness" does ? ## 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) ![](/static/mb/lessons/night-light-0.png)
<br /> <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) ![](/static/mb/lessons/night-light-1.png)
<br/> <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) ![](/static/mb/lessons/night-light-2.png)

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 ```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 ```blocks
let jumps = 0 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 ```blocks

View File

@ -45,7 +45,7 @@ while (rotating) {
It is a **while** loop that will be executed only if the ** variable** called `rotating` is **true**. 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 ```blocks
basic.showLeds(` basic.showLeds(`

View File

@ -10,7 +10,7 @@ Engineering: In this project, you will build your own seismograph micro:bit from
## What you'll need: ## What you'll need:
* BBC micro:bit * @boardname@
* micro USB cable * micro USB cable
* Plate * Plate
* Tape * Tape

View File

@ -11,7 +11,7 @@ Engineering: In this project, you will build a remote control based on the seism
## What you'll need: ## What you'll need:
* BBC micro:bits (2) * @boardname@s (2)
* micro USB cables (2) * micro USB cables (2)
* Plate * Plate
* Tape * Tape

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 ### ~avatar avatar

View File

@ -1,6 +1,6 @@
# speed button lesson # 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@.

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. 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 ```blocks
let count = 0 let count = 0
@ -18,7 +18,7 @@ let count = 0
![](/static/mb/lessons/speed-button-0.png) ![](/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 ```blocks
let count = 0 let count = 0
@ -34,7 +34,7 @@ input.onButtonPressed(Button.A, () => {
After two button presses, **count** will be equal to 2. 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 ```blocks
let count = 0 let count = 0

View File

@ -1,6 +1,6 @@
# spinner lesson # 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 ## 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 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 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 * learn how to declare a new local variable or update the value of a variable

View File

@ -1,6 +1,6 @@
# spinner quiz answers # 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 ## Name

View File

@ -1,6 +1,6 @@
# spinner quiz # 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 ## Name

View File

@ -1,6 +1,6 @@
# Block Editor STEM Lessons # Block Editor STEM Lessons
Overview of Blocks lessons for the BBC micro:bit. Overview of Blocks lessons for the @boardname@.
### @short Lessons ### @short Lessons
@ -9,9 +9,9 @@ Overview of Blocks lessons for the BBC micro:bit.
## Science ## Science
* [Night Light](/lessons/night-light), dim the LEDs with set brightness * [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 * [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 * [Zoomer](/lessons/zoomer), measure the force with acceleration
* [Glowing pendulum](/lessons/glowing-pendulum), construct a pendulum that glows using 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 * [Flashing heart](/lessons/flashing-heart), display images with a pause
* [Blink](/lessons/blink), turn an LED on and off with plot * [Blink](/lessons/blink), turn an LED on and off with plot
* [Happy birthday](/lessons/happy-birthday), create a popular song * [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@
### ~ ### ~

View File

@ -1,6 +1,6 @@
# Teach Blocks # Teach Blocks
Overview of lesson instructions for the BBC micro:bit. Overview of lesson instructions for the @boardname@.
### @short Teach ### @short Teach
@ -34,7 +34,7 @@ The quiz answers provide responses to the quiz. This will allow teachers to accu
5) Challenges 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 ## 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 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 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 ``05:00`` Distribute Lesson Quiz
``07:00`` Access BBC micro:bit website ``07:00`` Access @boardname@ website
``10:00`` Start Lesson Activity & Lesson Quiz ``10:00`` Start Lesson Activity & Lesson Quiz

View File

@ -1,6 +1,6 @@
# temperature blocks lesson # temperature blocks lesson
measure the temperature on the BBC micro:bit. measure the temperature on the @boardname@.
## Topic ## Topic

View File

@ -1,6 +1,6 @@
# truth or dare lesson # 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 ## 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 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 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 * learn how to declare a new local variable or update the value of a variable

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 ```blocks
basic.showLeds(` basic.showLeds(`

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) 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 ```blocks
let random = Math.random(4) let random = Math.random(4)

View File

@ -16,7 +16,7 @@ Answer the questions while completing the tutorial. Pay attention to the dialogu
<br/> <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/> <br/>

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" 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*. to see if she has to provide a *truth* or a *dare*.

View File

@ -4,7 +4,7 @@ An introduction to variables for the Block Editor.
## What is a variable? ## 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. 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 * 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 * 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) * 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 * This effectively creates a counter
Variables can also be used for conditions with loops. See the 'Loops' section to learn about this. Variables can also be used for conditions with loops. See the 'Loops' section to learn about this.

View File

@ -6,7 +6,7 @@ This is the answer key for the [zoomer quiz](/lessons/zoomer/quiz).
## 1. What is 'acceleration'? ## 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 ## 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 ## 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/> <br/>

View File

@ -18,7 +18,7 @@ Answer the questions while completing the tutorial. Pay attention to the dialogu
<br/> <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/> <br/>

View File

@ -35,7 +35,7 @@ input.onGesture(Gesture.Shake, () => {
} }
}) })
``` ```
In this project, you will build a Rock Paper Scissors game with the BBC micro:bit. In this project, you will build a Rock Paper Scissors game with the @boardname@.
You can play the game with a friend who has it on a micro:bit. You can play the game with a friend who has it on a micro:bit.
You can also play it with friends who are just using their hands. You can also play it with friends who are just using their hands.
@ -44,7 +44,7 @@ You can also play it with friends who are just using their hands.
## Materials needed ## Materials needed
* Your BBC micro:bit -- that's it! * Your @boardname@ -- that's it!
## Step 1: Getting started ## Step 1: Getting started

View File

@ -35,7 +35,7 @@ basic.forever(() => {
The following example keeps showing the [number](/reference/types/number) stored in a global variable. The following example keeps showing the [number](/reference/types/number) stored in a global variable.
When you press button `A`, the number gets bigger. When you press button `A`, the number gets bigger.
You can use a program like this to count things with your BBC micro:bit. You can use a program like this to count things with your @boardname@.
```blocks ```blocks
let num = 0 let num = 0

View File

@ -21,7 +21,7 @@ basic.showAnimation(`
In this animation, each row is 15 spaces wide because In this animation, each row is 15 spaces wide because
there are three frames in the animation, and each frame is there are three frames in the animation, and each frame is
five spaces wide, just like the screen on the BBC micro:bit. five spaces wide, just like the screen on the @boardname@.
```blocks ```blocks
basic.showAnimation(` basic.showAnimation(`

View File

@ -66,9 +66,9 @@ Everything described above relates to devices which are connected and communicat
In GAP, one devices advertises, emitting small packets of data periodically. These packets contain information about the device doing the advertising. Other devices looking for devices to connect to perform something called scanning, receiving and processing advertising packets and filtering out those that come from devices of a type that are not of interest. Usually the user is given information about devices which are discovered and they then select one to be connected to. The device which advertises is called a Bluetooth Peripheral whereas the one doing the scanning is a Bluetooth Central device. micro:bit is a Bluetooth peripheral. In GAP, one devices advertises, emitting small packets of data periodically. These packets contain information about the device doing the advertising. Other devices looking for devices to connect to perform something called scanning, receiving and processing advertising packets and filtering out those that come from devices of a type that are not of interest. Usually the user is given information about devices which are discovered and they then select one to be connected to. The device which advertises is called a Bluetooth Peripheral whereas the one doing the scanning is a Bluetooth Central device. micro:bit is a Bluetooth peripheral.
Bluetooth on the BBC micro:bit Bluetooth on the @boardname@
Full documentation for the BBC micro:bit Bluetooth profile as used by this application can be found at the [Lancaster University documentation](http://lancaster-university.github.io/microbit-docs/ble/profile/) web site. Full documentation for the @boardname@ Bluetooth profile as used by this application can be found at the [Lancaster University documentation](http://lancaster-university.github.io/microbit-docs/ble/profile/) web site.
The micro:bit's accelerometer (motion detector), magnetometer (digital compass), two buttons on the front, LED Display, IO pins on the edge connector, internal message bus and internal temperature sensor are all exposed as Services so that applications can exploit these features of the device. In addition: The micro:bit's accelerometer (motion detector), magnetometer (digital compass), two buttons on the front, LED Display, IO pins on the edge connector, internal message bus and internal temperature sensor are all exposed as Services so that applications can exploit these features of the device. In addition:
@ -82,7 +82,7 @@ Everything you can do with the micro:bit over Bluetooth is achieved through read
The Bluetooth SIG web site at http://www.bluetooth.com is a good place for further information about Bluetooth in general. You'll find all the SIG defined profiles, services, characteristics and descriptors there as well as the core specification for all Bluetooth technology. The Bluetooth SIG web site at http://www.bluetooth.com is a good place for further information about Bluetooth in general. You'll find all the SIG defined profiles, services, characteristics and descriptors there as well as the core specification for all Bluetooth technology.
That's it! Enjoy using Bluetooth on the BBC micro:bit! That's it! Enjoy using Bluetooth on the @boardname@!
Martin Woolley, Bluetooth SIG. Twitter: @bluetooth_mdw Martin Woolley, Bluetooth SIG. Twitter: @bluetooth_mdw

View File

@ -31,7 +31,7 @@ Your micro:bit is now ready to be paired with the other device. Read the section
1. Go into Settings 1. Go into Settings
2. Select Bluetooth 2. Select Bluetooth
3. Switch your micro:bit into 'pairing mode' using the steps above 3. Switch your micro:bit into 'pairing mode' using the steps above
4. Wait until 'PAIRING MODE!' has finished scrolling across the micro:bit display. You should see your micro:bit listed on your Windows smartphone with a name something like 'BBC micro:bit [zatig]'. Note that the 5 characters in brackets at the end will vary. 4. Wait until 'PAIRING MODE!' has finished scrolling across the micro:bit display. You should see your micro:bit listed on your Windows smartphone with a name something like '@boardname@ [zatig]'. Note that the 5 characters in brackets at the end will vary.
5. On the Windows smartphone, tap the micro:bit named in the device list. This will initiate the pairing process. 5. On the Windows smartphone, tap the micro:bit named in the device list. This will initiate the pairing process.
6. The micro:bit will display a left pointing arrow and the Windows smartphone will pop up a box into which you will be invited to enter a "pin" (Personal Identity Number). 6. The micro:bit will display a left pointing arrow and the Windows smartphone will pop up a box into which you will be invited to enter a "pin" (Personal Identity Number).
7. Press button A on the micro:bit and watch carefully as the micro:bit displays a sequence of 6 random numbers. You may find it easier to write them down than to remember them. 7. Press button A on the micro:bit and watch carefully as the micro:bit displays a sequence of 6 random numbers. You may find it easier to write them down than to remember them.
@ -47,7 +47,7 @@ https://www.youtube.com/watch?v=AoW3mit7jIg
1. Go into Settings 1. Go into Settings
2. Select Bluetooth 2. Select Bluetooth
3. Switch your micro:bit into 'pairing mode' using the steps above 3. Switch your micro:bit into 'pairing mode' using the steps above
4. Wait until 'PAIRING MODE!' has finished scrolling across the micro:bit display. You should see your micro:bit listed on your Android smartphone under the heading "Available devices" with a name something like 'BBC micro:bit [zatig]'. Note that the 5 characters in brackets at the end will vary. 4. Wait until 'PAIRING MODE!' has finished scrolling across the micro:bit display. You should see your micro:bit listed on your Android smartphone under the heading "Available devices" with a name something like '@boardname@ [zatig]'. Note that the 5 characters in brackets at the end will vary.
5. On the Android smartphone, tap the micro:bit named in the Available devices list. This will initiate the pairing process. 5. On the Android smartphone, tap the micro:bit named in the Available devices list. This will initiate the pairing process.
6. The micro:bit will display a left pointing arrow and the Android smartphone will pop up a box into which you will be invited to enter a "pin" (Personal Identity Number). 6. The micro:bit will display a left pointing arrow and the Android smartphone will pop up a box into which you will be invited to enter a "pin" (Personal Identity Number).
7. Press button A on the micro:bit and watch carefully as the micro:bit displays a sequence of 6 random numbers. You may find it easier to write them down than to remember them. 7. Press button A on the micro:bit and watch carefully as the micro:bit displays a sequence of 6 random numbers. You may find it easier to write them down than to remember them.

View File

@ -1,6 +1,6 @@
# Reset # Reset
Reset the BBC micro:bit and start the program again. Reset the @boardname@ and start the program again.
This function is like pressing the reset button on the back of the micro:bit. This function is like pressing the reset button on the back of the micro:bit.

View File

@ -1,6 +1,6 @@
# Devices # Devices
Control a phone with the BBC micro:bit via Bluetooth. Control a phone with the @boardname@ via Bluetooth.
```cards ```cards
devices.tellCameraTo(MesCameraEvent.TakePhoto); devices.tellCameraTo(MesCameraEvent.TakePhoto);

View File

@ -4,9 +4,9 @@ Register code to run when the micro:bit receives a command from the paired gamep
### ~hint ### ~hint
The functions in the ``devices`` namespace allow the BBC micro:bit to communicate with a separate (remote) device, The functions in the ``devices`` namespace allow the @boardname@ to communicate with a separate (remote) device,
such as a smartphone, over Bluetooth (Smart). such as a smartphone, over Bluetooth (Smart).
The set of supported events will depend on the remote device and the BBC micro:bit apps available for the remote device. The set of supported events will depend on the remote device and the @boardname@ apps available for the remote device.
### ~ ### ~

View File

@ -4,9 +4,9 @@ Register code to run when the signal strength of the paired device changes.
### ~hint ### ~hint
The functions in the ``devices`` namespace allow the BBC micro:bit to communicate with a separate (remote) device, The functions in the ``devices`` namespace allow the @boardname@ to communicate with a separate (remote) device,
such as a smartphone, over Bluetooth (Smart). such as a smartphone, over Bluetooth (Smart).
The set of supported events will depend on the remote device and the BBC micro:bit apps available for the remote device. The set of supported events will depend on the remote device and the @boardname@ apps available for the remote device.
### ~ ### ~

View File

@ -4,9 +4,9 @@ Register code to run when the signal strength of the paired device changes.
### ~hint ### ~hint
The functions in the ``devices`` namespace allow the BBC micro:bit to communicate with a separate (remote) device, The functions in the ``devices`` namespace allow the @boardname@ to communicate with a separate (remote) device,
such as a smartphone, over Bluetooth (Smart). such as a smartphone, over Bluetooth (Smart).
The set of supported events will depend on the remote device and the BBC micro:bit apps available for the remote device. The set of supported events will depend on the remote device and the @boardname@ apps available for the remote device.
### ~ ### ~

View File

@ -4,9 +4,9 @@ Raise an alert on a remote device.
### ~hint ### ~hint
The functions in the ``devices`` namespace allow the BBC micro:bit to communicate with a separate (remote) device, The functions in the ``devices`` namespace allow the @boardname@ to communicate with a separate (remote) device,
such as a smartphone, over Bluetooth (Smart). such as a smartphone, over Bluetooth (Smart).
The set of supported events will depend on the remote device and the BBC micro:bit apps available for the remote device. The set of supported events will depend on the remote device and the @boardname@ apps available for the remote device.
### ~ ### ~

View File

@ -4,9 +4,9 @@ Returns the signal strength reported by the paired device from ``0`` (no signal)
### ~hint ### ~hint
The functions in the ``devices`` namespace allow the BBC micro:bit to communicate with a separate (remote) device, The functions in the ``devices`` namespace allow the @boardname@ to communicate with a separate (remote) device,
such as a smartphone, over Bluetooth (Smart). such as a smartphone, over Bluetooth (Smart).
The set of supported events will depend on the remote device and the BBC micro:bit apps available for the remote device. The set of supported events will depend on the remote device and the @boardname@ apps available for the remote device.
### ~ ### ~

View File

@ -4,9 +4,9 @@ Access the photo/video-taking functionality of a remote device using the ``tell
### ~hint ### ~hint
The functions in the ``devices`` namespace allow the BBC micro:bit to communicate with a separate (remote) device, The functions in the ``devices`` namespace allow the @boardname@ to communicate with a separate (remote) device,
such as a smartphone, over Bluetooth (Smart). such as a smartphone, over Bluetooth (Smart).
The set of supported events will depend on the remote device and the BBC micro:bit apps available for the remote device. The set of supported events will depend on the remote device and the @boardname@ apps available for the remote device.
### ~ ### ~

View File

@ -4,9 +4,9 @@ Control the presentation of media content available on a remote device using the
### ~hint ### ~hint
The functions in the ``devices`` namespace allow the BBC micro:bit to communicate with a separate (remote) device, The functions in the ``devices`` namespace allow the @boardname@ to communicate with a separate (remote) device,
such as a smartphone, over Bluetooth (Smart). such as a smartphone, over Bluetooth (Smart).
The set of supported events will depend on the remote device and the BBC micro:bit apps available for the remote device. The set of supported events will depend on the remote device and the @boardname@ apps available for the remote device.
### ~ ### ~

View File

@ -51,7 +51,7 @@ input.onButtonPressed(Button.A, () => {
### To learn more ### To learn more
To learn more about how the BBC micro:bit queues up and schedules event handlers, see [the BBC micro:bit - a reactive system](/device/reactive) To learn more about how the @boardname@ queues up and schedules event handlers, see [the @boardname@ - a reactive system](/device/reactive)
### see also ### see also

View File

@ -2,7 +2,7 @@
The plot frame function. The plot frame function.
Display an [Image](/reference/images/image) on the BBC micro:bit's [LED screen](/device/screen) Display an [Image](/reference/images/image) on the @boardname@'s [LED screen](/device/screen)
### JavaScript ### JavaScript

View File

@ -2,7 +2,7 @@
The plot image function. The plot image function.
Display an [Image](/reference/images/image) on the BBC micro:bit's [LED screen](/device/screen) Display an [Image](/reference/images/image) on the @boardname@'s [LED screen](/device/screen)
### JavaScript ### JavaScript

View File

@ -2,7 +2,7 @@
The show frame function. The show frame function.
Display an [Image](/reference/images/image) on the BBC micro:bit's [LED screen](/device/screen) Display an [Image](/reference/images/image) on the @boardname@'s [LED screen](/device/screen)
### JavaScript ### JavaScript

View File

@ -2,7 +2,7 @@
Find the light level (how bright or dark it is) where you are. Find the light level (how bright or dark it is) where you are.
The light level ``0`` means darkness and ``255`` means bright light. The light level ``0`` means darkness and ``255`` means bright light.
The BBC micro:bit measures the light around it by using some of the The @boardname@ measures the light around it by using some of the
LEDs on the [LED screen](/device/screen). LEDs on the [LED screen](/device/screen).
The first time you use it, this function will say ``0``. The first time you use it, this function will say ``0``.

View File

@ -3,7 +3,7 @@
Start an [event handler](/reference/event-handler) (part of the program that will run when something happens, like when a button is pressed). Start an [event handler](/reference/event-handler) (part of the program that will run when something happens, like when a button is pressed).
This handler works when button `A` or `B` is pressed, or `A` and `B` together. This handler works when button `A` or `B` is pressed, or `A` and `B` together.
When you are using this function in a web browser, click the buttons on the screen instead of the ones When you are using this function in a web browser, click the buttons on the screen instead of the ones
on the BBC micro:bit. on the @boardname@.
```sig ```sig
input.onButtonPressed(Button.A, () => {}) input.onButtonPressed(Button.A, () => {})

View File

@ -19,7 +19,7 @@ input.onPinPressed(TouchPin.P0, () => {
## ~hint ## ~hint
This function works best when the BBC micro:bit is using batteries for power, This function works best when the @boardname@ is using batteries for power,
instead of the USB cable. instead of the USB cable.
## ~ ## ~
@ -44,5 +44,5 @@ input.onPinPressed(TouchPin.P0, () => {
### See also ### See also
[BBC micro:bit pins](/device/pins), [pin is pressed](/reference/input/pin-is-pressed), [analog read pin](/reference/pins/analog-read-pin), [analog write pin](/reference/pins/analog-write-pin), [digital read pin](/reference/pins/digital-read-pin), [digital write pin](/reference/pins/digital-write-pin) [@boardname@ pins](/device/pins), [pin is pressed](/reference/input/pin-is-pressed), [analog read pin](/reference/pins/analog-read-pin), [analog write pin](/reference/pins/analog-write-pin), [digital read pin](/reference/pins/digital-read-pin), [digital write pin](/reference/pins/digital-write-pin)

View File

@ -19,7 +19,7 @@ input.onPinReleased(TouchPin.P0, () => {
## ~hint ## ~hint
This function works best when the BBC micro:bit is using batteries for power, This function works best when the @boardname@ is using batteries for power,
instead of the USB cable. instead of the USB cable.
## ~ ## ~
@ -44,5 +44,5 @@ input.onPinReleased(TouchPin.P0, () => {
### See also ### See also
[BBC micro:bit pins](/device/pins), [pin is pressed](/reference/input/pin-is-pressed), [analog read pin](/reference/pins/analog-read-pin), [analog write pin](/reference/pins/analog-write-pin), [digital read pin](/reference/pins/digital-read-pin), [digital write pin](/reference/pins/digital-write-pin) [@boardname@ pins](/device/pins), [pin is pressed](/reference/input/pin-is-pressed), [analog read pin](/reference/pins/analog-read-pin), [analog write pin](/reference/pins/analog-write-pin), [digital read pin](/reference/pins/digital-read-pin), [digital write pin](/reference/pins/digital-write-pin)

View File

@ -12,7 +12,7 @@ input.pinIsPressed(TouchPin.P0);
## ~hint ## ~hint
This function works best when the BBC micro:bit is using batteries for power, This function works best when the @boardname@ is using batteries for power,
instead of the USB cable. instead of the USB cable.
## ~ ## ~
@ -41,5 +41,5 @@ basic.forever(() => {
### See also ### See also
[BBC micro:bit pins](/device/pins), [on pin pressed](/reference/input/on-pin-pressed), [analog read pin](/reference/pins/analog-read-pin), [analog write pin](/reference/pins/analog-write-pin), [digital read pin](/reference/pins/digital-read-pin), [digital write pin](/reference/pins/digital-write-pin) [@boardname@ pins](/device/pins), [on pin pressed](/reference/input/on-pin-pressed), [analog read pin](/reference/pins/analog-read-pin), [analog write pin](/reference/pins/analog-write-pin), [digital read pin](/reference/pins/digital-read-pin), [digital write pin](/reference/pins/digital-write-pin)

View File

@ -8,7 +8,7 @@ input.rotation(Rotation.Roll);
## ~hint ## ~hint
The BBC micro:bit has a part called the **accelerometer** that can The @boardname@ has a part called the **accelerometer** that can
check how the micro:bit is moving. check how the micro:bit is moving.
## ~ ## ~
@ -23,7 +23,7 @@ check how the micro:bit is moving.
### Example: micro:bit leveler ### Example: micro:bit leveler
This program helps you move the BBC micro:bit until it is level. When This program helps you move the @boardname@ until it is level. When
it is level, the micro:bit shows a smiley. it is level, the micro:bit shows a smiley.
If you are running this program in a browser, you can tilt the If you are running this program in a browser, you can tilt the

View File

@ -13,7 +13,7 @@ input.temperature();
### How does it work? ### How does it work?
The BBC micro:bit checks how hot its CPU (main computer chip) is. The @boardname@ checks how hot its CPU (main computer chip) is.
Because the micro:bit does not usually get very hot, the temperature of the CPU Because the micro:bit does not usually get very hot, the temperature of the CPU
is usually close to the temperature of wherever you are. is usually close to the temperature of wherever you are.
The micro:bit might warm up a little if you make it work hard, though! The micro:bit might warm up a little if you make it work hard, though!

View File

@ -11,7 +11,7 @@ led.plotBarGraph(2, 20);
* ``value`` is a [number](/reference/types/number) that means what you * ``value`` is a [number](/reference/types/number) that means what you
are measuring or trying to show. For example, if you are measuring are measuring or trying to show. For example, if you are measuring
the temperature of ice with the BBC micro:bit, ``value`` might be `0` the temperature of ice with the @boardname@, ``value`` might be `0`
because the temperature might be 0 degrees centigrade. because the temperature might be 0 degrees centigrade.
* ``high`` is a [number](/reference/types/number) that means the highest * ``high`` is a [number](/reference/types/number) that means the highest
possible number that the ``value`` parameter can be. This number is possible number that the ``value`` parameter can be. This number is

View File

@ -1,6 +1,6 @@
# Plot LEDs # Plot LEDs
Display an [Image](/reference/images/image) on the BBC micro:bit's [LED screen](/device/screen). NOTE: `basic -> plot image` has been replaced by `basic -> show leds`. Display an [Image](/reference/images/image) on the @boardname@'s [LED screen](/device/screen). NOTE: `basic -> plot image` has been replaced by `basic -> show leds`.
```sig ```sig
basic.showLeds(` basic.showLeds(`

View File

@ -2,7 +2,7 @@
The behavior of functions whose parameter values are out of bounds. The behavior of functions whose parameter values are out of bounds.
Many of the BBC micro:bit functions have parameters. If a parameter is an unexpected value, the parameter is considered *out of bounds*. Many of the @boardname@ functions have parameters. If a parameter is an unexpected value, the parameter is considered *out of bounds*.
For example, the [plot](/reference/led/plot) function has two parameters: For example, the [plot](/reference/led/plot) function has two parameters:

View File

@ -22,7 +22,7 @@ pins.servoSetPulse(AnalogPin.P0, 1000)
### See also ### See also
[BBC micro:bit pins](/device/pins), [@boardname@ pins](/device/pins),
[on pin pressed](/reference/input/on-pin-pressed), [on pin pressed](/reference/input/on-pin-pressed),
[analog read pin](/reference/pins/analog-read-pin), [analog read pin](/reference/pins/analog-read-pin),
[digital read pin](/reference/pins/digital-read-pin), [digital read pin](/reference/pins/digital-read-pin),

View File

@ -44,5 +44,5 @@ pins.servoWritePin(AnalogPin.P0, 0)
### See also ### See also
[BBC micro:bit pins](/device/pins), [servo set pulse](/reference/pins/servo-set-pulse) [@boardname@ pins](/device/pins), [servo set pulse](/reference/pins/servo-set-pulse)

View File

@ -29,4 +29,4 @@ pins.setPull(DigitalPin.P0, PinPullMode.PullUp);
### See also ### See also
[BBC micro:bit | mbed](https://developer.mbed.org/platforms/Microbit/) [@boardname@ | mbed](https://developer.mbed.org/platforms/Microbit/)

View File

@ -1,7 +1,7 @@
# types # types
A *type* refers to a class of data and the operations permitted on that class of data. A *type* refers to a class of data and the operations permitted on that class of data.
The following built-in types are supported for the BBC micro:bit: The following built-in types are supported for the @boardname@:
* **[String](/reference/types/string)**: a sequence of characters * **[String](/reference/types/string)**: a sequence of characters
* **[Number](/reference/types/number)**: an integer number (32-bit signed) * **[Number](/reference/types/number)**: an integer number (32-bit signed)

View File

@ -4,7 +4,7 @@ a piece of text.
### @parent blocks/language ### @parent blocks/language
A *String* is a sequence of characters. For the BBC micro:bit, ASCII character codes 32 to 126 are supported; letters, digits, punctuation marks, and a few symbols. All other character codes appear as a ? on the [LED screen](/device/screen). A *String* is a sequence of characters. For the @boardname@, ASCII character codes 32 to 126 are supported; letters, digits, punctuation marks, and a few symbols. All other character codes appear as a ? on the [LED screen](/device/screen).
### Create a string variable ### Create a string variable

Some files were not shown because too many files have changed in this diff Show More