rename micro:bit to @boardname@

This commit is contained in:
Peli de Halleux
2016-11-01 17:44:37 -07:00
parent 9bc1e38345
commit 89406330cf
226 changed files with 697 additions and 750 deletions

View File

@ -16,7 +16,7 @@ The compilation from a script to ARM machine code is now done entirely in the br
![](/static/mb/offline-2.png)
The C++ compiler now only is used to compile the micro:bit runtime - this is done offline by the micro:bit team and the precompiled runtime linked with your compiled script in the browser.
The C++ compiler now only is used to compile the @boardname@ runtime - this is done offline by the @boardname@ team and the precompiled runtime linked with your compiled script in the browser.
## Save and load code using files

View File

@ -1,6 +1,6 @@
# micro:bit/JavaScript Documentation
# @boardname@/JavaScript Documentation
JavaScript docs for the micro:bit
JavaScript docs for the @boardname@
### @section full
@ -194,7 +194,7 @@ Functions in this category require to be connected to a remote device.
## Debugging
* use the [serial library](/js/serial-library) to print data from your micro:bit on your computer
* use the [serial library](/js/serial-library) to print data from your @boardname@ on your computer
* learn about the [device error codes](/device/errors) that are displayed when sad faces occur
## Edit/Publish

View File

@ -2,7 +2,7 @@
### Challenge 0
You have successfully following the [guided tutorial] (https://live.microbit.co.uk/td/tutorials/blink). If not, we should make sure the micro:bit script displays a blinking script on screen. We want to plot the x and y coordinates to 2, 2. Additionally, you will pause by 100 milliseconds then you will clear the screen of the micro:bit. Let's give it a go!
You have successfully following the [guided tutorial] (https://live.microbit.co.uk/td/tutorials/blink). If not, we should make sure the @boardname@ script displays a blinking script on screen. We want to plot the x and y coordinates to 2, 2. Additionally, you will pause by 100 milliseconds then you will clear the screen of the @boardname@. Let's give it a go!
```
while (true) {

View File

@ -2,7 +2,7 @@
### Challenge 0
You have successfully following the [blink tutorial](/hcwxud). If not, then let's start the tutorial now. Your micro:bit script should start by displaying a blinking script on screen. We want to plot the x and y coordinates to 2, 2. Additionally, you will pause by 100 milliseconds then clear the screen of the micro:bit.
You have successfully following the [blink tutorial](/hcwxud). If not, then let's start the tutorial now. Your @boardname@ script should start by displaying a blinking script on screen. We want to plot the x and y coordinates to 2, 2. Additionally, you will pause by 100 milliseconds then clear the screen of the @boardname@.
Let's give it a go!

View File

@ -4,7 +4,7 @@ My script. #docs
**Challenge 0**
This [guided tutorial](/xuhkviyyxa) introduces how to make an image look like it's scrolling across the micro:bit!
This [guided tutorial](/xuhkviyyxa) introduces how to make an image look like it's scrolling across the @boardname@!
We can use an animation to make an image look like its moving!

View File

@ -1,6 +1,6 @@
# TouchDevelop Lessons
Overview of TouchDevelop lessons for the micro:bit.
Overview of TouchDevelop lessons for the @boardname@.
### @section full
@ -15,7 +15,7 @@ Overview of TouchDevelop lessons for the micro:bit.
* [point](/reference/led/point)
* [set brightness](/tfrmcgdtxk)
## micro:bit
## @boardname@
## functions
@ -88,7 +88,7 @@ Overview of TouchDevelop lessons for the micro:bit.
* [markdown](/js/markdown)
* [creating interactive tutorials](/js/creatinginteractivetutorials)
* [run scripts in a web browser](/js/simulator)
* [run scripts on your micro:bit](/usb)
* [run scripts on your @boardname@](/usb)
* [libraries](/js/libraries)
### Functions and libraries

View File

@ -1,6 +1,6 @@
# Image
An image for the micro:bit screen.
An image for the @boardname@ screen.
### @parent js/language

View File

@ -4,7 +4,7 @@ The acceleration function.
**Challenge 0**
Great job! You have successfully completed the [zoomer tutorial](https://test.microbit.co.uk/td/lessons/zoomer/challenges) . You have created a script that measures the acceleration on the micro:bit in the "z" direction of a 3D world.
Great job! You have successfully completed the [zoomer tutorial](https://test.microbit.co.uk/td/lessons/zoomer/challenges) . You have created a script that measures the acceleration on the @boardname@ in the "z" direction of a 3D world.
```
basic.forever(() => {
@ -49,7 +49,7 @@ basic.forever(() => {
### Challenge 3
If Button `B` is pressed, program the micro:bit to display the acceleration in the "y" direction.
If Button `B` is pressed, program the @boardname@ to display the acceleration in the "y" direction.
You can do this by storing the acceleration in a variable: `var milliY := input->acceleration("y")`.

View File

@ -8,7 +8,7 @@ This [guided tutorial](/lessons/boxer-mania/tutorial) will help you create an an
Let's create and show a series of frames on the LED screen; this is an animation!
We will use multiple frames to make it look like a square is rotating on the micro:bit screen!
We will use multiple frames to make it look like a square is rotating on the @boardname@ screen!
```
basic.showAnimation(`

View File

@ -19,7 +19,7 @@ input.onButtonPressed(Button.A, () => {
### Challenge 1
Now let's do something special when the micro:bit reaches the number `5`. Instead of just showing the number `5`, let's show the string `HALF WAY!`. Begin by setting an if statement to know when `counter = 5`.
Now let's do something special when the @boardname@ reaches the number `5`. Instead of just showing the number `5`, let's show the string `HALF WAY!`. Begin by setting an if statement to know when `counter = 5`.
```
counter = 0
@ -56,7 +56,7 @@ input.onButtonPressed(Button.A, () => {
### Challenge 3
You may notice a problem right now. When `counter = 5`, the micro:bit will show both the message `HALF WAY!` and the number `5`. In order to fix this problem, let's take advantage of the `else` at the end of the if statement.
You may notice a problem right now. When `counter = 5`, the @boardname@ will show both the message `HALF WAY!` and the number `5`. In order to fix this problem, let's take advantage of the `else` at the end of the if statement.
```
counter = 0
@ -75,5 +75,5 @@ input.onButtonPressed(Button.A, () => {
### Challenge 4
When `counter = 8`, display the message `ALMOST THERE!` on the micro:bit. You will need to add an `else if` after the if statement of `counter = 5`.
When `counter = 8`, display the message `ALMOST THERE!` on the @boardname@. You will need to add an `else if` after the if statement of `counter = 5`.

View File

@ -67,10 +67,10 @@ Learn how to create **functions**, `function()` that perform a specific task and
* learn how to set or change the value of a global variable
* learn how to repeat code in the background forever
* learn how to get the state of an input button
* learn how to show a number on the micro:bit's LED screen
* learn how to show a string on the micro:bit's LED screen
* learn how to create an image to show on the micro:bit's LED screen
* learn how to show an image on the micro:bit's LED screen
* learn how to show a number on the @boardname@'s LED screen
* learn how to show a string on the @boardname@'s LED screen
* learn how to create an image to show on the @boardname@'s LED screen
* learn how to show an image on the @boardname@'s LED screen
* learn how to pause your code for the specified number of milliseconds
## Links to the National Curriculum Programmes of Study for Computing

View File

@ -2,7 +2,7 @@
Turn a LED on and off. #docs
Detect and show an image when the micro:bit falls.
Detect and show an image when the @boardname@ falls.
* [tutorial](/lessons/landslide/tutorial)
* [challenges](/lessons/landslide/challenges)

View File

@ -73,5 +73,5 @@ input.onFall(() => {
### Challenge 3
Now let's display a third image when the micro:bit falls! First, add `basic->pause(2000)` followed by another image of your choice. Be creative!
Now let's display a third image when the @boardname@ falls! First, add `basic->pause(2000)` followed by another image of your choice. Be creative!

View File

@ -48,7 +48,7 @@ Learn how to create **functions**, `function()` that perform a specific task and
* learn how to repeat code in the background forever
* learn how to conditionally run code depending on whether a condition is true or not
* learn how to run code when an input button is pressed
* learn how to show a string on the micro:bit's LED screen
* learn how to show a string on the @boardname@'s LED screen
* learn how to turn on a LED light on the LED screen. Learn how to specify which LED using x, y coordinates
* learn how to turn off a LED light on the LED screen. Learn how to specify which LED using x, y coordinates
* learn how to pause your code for the specified number of milliseconds

View File

@ -67,5 +67,5 @@ input.onLogoDown(() => {
**Challenge 3**
Let's show a spinning arrow when the micro:bit is shaken. We can do this by adding an on shake condition and showing an animation of the arrow spinning!
Let's show a spinning arrow when the @boardname@ is shaken. We can do this by adding an on shake condition and showing an animation of the arrow spinning!

View File

@ -52,8 +52,8 @@ Learn how to create **functions**, `function()` that perform a specific task and
* learn how to gradually increase the LED screen brightness until the LED lights are turned on
* learn how to conditionally run code depending on whether a condition is true or not
* learn how to run code when an input button is pressed
* learn how to show a number on the micro:bit's LED screen
* learn how to show a string on the micro:bit's LED screen
* learn how to show a number on the @boardname@'s LED screen
* learn how to show a string on the @boardname@'s LED screen
* learn how to turn on a LED light on the LED screen. Learn how to specify which LED using x, y coordinates
* learn how to turn on all the 25 LEDs on the LED screen
* learn how to pause your code for the specified number of milliseconds

View File

@ -121,7 +121,7 @@ for (let i4 = 0; i4 < 4; i4++) {
**Questions 10-14 are concerned with 'number pysch controller tutorial'**
## 10. Write the code that asks for a player number if button 'A' is pressed on the BBC controller micro:bit.
## 10. Write the code that asks for a player number if button 'A' is pressed on the BBC controller @boardname@.
<br />
@ -162,7 +162,7 @@ input.onButtonPressed(Button.B, () => {
})
```
## 13. Create a while loop that first reads which controller the console micro:bit is requesting data from. Plot a waiting image, and then write an IF statement to check if the request corresponds to the controller. (Don't worry about writing anything inside the if statement).
## 13. Create a while loop that first reads which controller the console @boardname@ is requesting data from. Plot a waiting image, and then write an IF statement to check if the request corresponds to the controller. (Don't worry about writing anything inside the if statement).
<br />

View File

@ -80,7 +80,7 @@ Answer the questions while completing the tutorial. Pay attention to the dialogu
**Questions 10-14 are concerned with 'number pysch controller tutorial'**
## 10. Write the code that asks for a player number if button 'A' is pressed on the BBC controller micro:bit.
## 10. Write the code that asks for a player number if button 'A' is pressed on the BBC controller @boardname@.
<br />
@ -100,7 +100,7 @@ Answer the questions while completing the tutorial. Pay attention to the dialogu
<br/>
## 13. Create a while loop that first reads which controller the console micro:bit is requesting data from. Plot a waiting image, and then write an IF statement to check if the request corresponds to the controller. (Don't worry about writing anything inside the if statement).
## 13. Create a while loop that first reads which controller the console @boardname@ is requesting data from. Plot a waiting image, and then write an IF statement to check if the request corresponds to the controller. (Don't worry about writing anything inside the if statement).
<br />

View File

@ -4,7 +4,7 @@ The on fall function.
### Challenge 0
Welcome! This [guided tutorial](https://live.microbit.co.uk/td/lessons/on-fall/tutorial) will show you how to detect when the micro:bit is falling. Your goal is to write a program that detects when the micro:bit falls!
Welcome! This [guided tutorial](https://live.microbit.co.uk/td/lessons/on-fall/tutorial) will show you how to detect when the @boardname@ is falling. Your goal is to write a program that detects when the @boardname@ falls!
```
input.onFall(() => {
@ -61,7 +61,7 @@ input.onFall(() => {
### Challenge 3
Create a loop so that the micro:bit alternates between the exclamation point and "X" images when the micro:bit falls. You will need a `forever` loop and a pause at the end of the loop to do this.
Create a loop so that the @boardname@ alternates between the exclamation point and "X" images when the @boardname@ falls. You will need a `forever` loop and a pause at the end of the loop to do this.
## See Also

View File

@ -1,6 +1,6 @@
# flipping bird challenges
These challenges will allow you to create and display a flipping image of a bird when the micro:bit is shaken. #docs
These challenges will allow you to create and display a flipping image of a bird when the @boardname@ is shaken. #docs
### Challenge 0

View File

@ -1,6 +1,6 @@
# pong lesson
code your own game of Pong on the micro:bit. #.
code your own game of Pong on the @boardname@. #.
## Topic
@ -71,7 +71,7 @@ Learn how to create **functions**, `function()` that perform a specific task and
* learn how to repeat code in the background forever
* learn how to conditionally run code depending on whether a condition is true or not
* learn how to run code when an input button is pressed
* learn how to show a string on the micro:bit's LED screen
* learn how to show a string on the @boardname@'s LED screen
* learn how to turn on a LED light on the LED screen. Learn how to specify which LED using x, y coordinates
* learn how to turn off a LED light on the LED screen. Learn how to specify which LED using x, y coordinates
* learn how to pause your code for the specified number of milliseconds

View File

@ -8,7 +8,7 @@ Welcome! This guide will show you how to complete the challenges for the game of
### Step 16
Awesome! You have just created your game of rock paper scissors. However, why don't we add a little more to it? We can keep track of your score against the micro:bit using global variables. Create a global variable to keep track of the wins against the micro:bit. To do so, click on `add new`, then `Data`, and then `Number`.
Awesome! You have just created your game of rock paper scissors. However, why don't we add a little more to it? We can keep track of your score against the @boardname@ using global variables. Create a global variable to keep track of the wins against the @boardname@. To do so, click on `add new`, then `Data`, and then `Number`.
```
var wins: number = 0
@ -16,7 +16,7 @@ var wins: number = 0
### Step 17
At the beginning of the game, you don't have any wins against the micro:bit. As a result, let's set the `data->wins` variable to 0 at the top of your main function.
At the beginning of the game, you don't have any wins against the @boardname@. As a result, let's set the `data->wins` variable to 0 at the top of your main function.
```
wins = 0 // ***
@ -78,7 +78,7 @@ input.onButtonPressed(Button.A, () => {
### Step 20
You have tracked the number of wins you have against the micro:bit. However, how will you ever know how many wins you have? After we increment `data->wins`, let's display the total number of wins you have.
You have tracked the number of wins you have against the @boardname@. However, how will you ever know how many wins you have? After we increment `data->wins`, let's display the total number of wins you have.
```
wins = 0
@ -100,13 +100,13 @@ input.onButtonPressed(Button.A, () => {
})
```
* Tap `run` to run the program on the simulator. Notice the number of wins you have against the micro:bit.
* Tap `run` to run the program on the simulator. Notice the number of wins you have against the @boardname@.
## Challenge 2
### Step 21
You have managed to keep score of the number of wins you have against the micro:bit. However, what about losses? Let's begin by creating another global variable to keep track of losses.
You have managed to keep score of the number of wins you have against the @boardname@. However, what about losses? Let's begin by creating another global variable to keep track of losses.
```
var losses: number = 0
@ -114,7 +114,7 @@ var losses: number = 0
### Step 22
Add a condition for when button `B` is pressed. When this occurs, we will increment your losses against the micro:bit by 1. Let's hope that this button will not be pressed too often!
Add a condition for when button `B` is pressed. When this occurs, we will increment your losses against the @boardname@ by 1. Let's hope that this button will not be pressed too often!
```
wins = 0
@ -167,7 +167,7 @@ input.onButtonPressed(Button.B, () => {
### Step 24
Let's also display the score when button `B` is pressed, just as we have done for button `A`. This will help us keep track of the number of wins and losses you have against the micro:bit.
Let's also display the score when button `B` is pressed, just as we have done for button `A`. This will help us keep track of the number of wins and losses you have against the @boardname@.
```
wins = 0
@ -198,7 +198,7 @@ input.onButtonPressed(Button.B, () => {
### Step 25
You have managed to keep track of both the wins and losses you have against the micro:bit! But did you notice that you haven't updated something? Take a look at condition of `input->on button pressed("A")`.
You have managed to keep track of both the wins and losses you have against the @boardname@! But did you notice that you haven't updated something? Take a look at condition of `input->on button pressed("A")`.
```
wins = 0
@ -229,7 +229,7 @@ input.onButtonPressed(Button.B, () => {
})
```
* Tap the `run` button to run your game on the simulator. See if you can get more wins than the micro:bit can!
* Tap the `run` button to run your game on the simulator. See if you can get more wins than the @boardname@ can!
Congratulations! You have successfully created a fully functional game of rock, paper, scissors against the micro:bit. Challenge your friends to see who can get a better score against the micro:bit.
Congratulations! You have successfully created a fully functional game of rock, paper, scissors against the @boardname@. Challenge your friends to see who can get a better score against the @boardname@.

View File

@ -8,7 +8,7 @@ Welcome! This guide will show you how to complete the challenges for the game of
### Step 16
Awesome! You have just created your game of rock paper scissors. However, why don't we add a little more to it? We can keep track of your score against the micro:bit using global variables. Create a global variable to keep track of the wins against the micro:bit. To do so, click on `add new`, then `Data`, and then `Number`.
Awesome! You have just created your game of rock paper scissors. However, why don't we add a little more to it? We can keep track of your score against the @boardname@ using global variables. Create a global variable to keep track of the wins against the @boardname@. To do so, click on `add new`, then `Data`, and then `Number`.
```
var wins: number = 0
@ -16,7 +16,7 @@ var wins: number = 0
### Step 17
At the beginning of the game, you don't have any wins against the micro:bit. As a result, let's set the `data->wins` variable to 0 at the top of your main function.
At the beginning of the game, you don't have any wins against the @boardname@. As a result, let's set the `data->wins` variable to 0 at the top of your main function.
```
wins = 0 // ***
@ -78,7 +78,7 @@ input.onButtonPressed(Button.A, () => {
### Step 20
You have tracked the number of wins you have against the micro:bit. However, how will you ever know how many wins you have? After we increment `data->wins`, let's display the total number of wins you have.
You have tracked the number of wins you have against the @boardname@. However, how will you ever know how many wins you have? After we increment `data->wins`, let's display the total number of wins you have.
```
wins = 0
@ -100,13 +100,13 @@ input.onButtonPressed(Button.A, () => {
})
```
* Tap `run` to run the program on the simulator. Notice the number of wins you have against the micro:bit.
* Tap `run` to run the program on the simulator. Notice the number of wins you have against the @boardname@.
## Challenge 2
### Step 21
You have managed to keep score of the number of wins you have against the micro:bit. However, what about losses? Let's begin by creating another global variable to keep track of losses.
You have managed to keep score of the number of wins you have against the @boardname@. However, what about losses? Let's begin by creating another global variable to keep track of losses.
```
var losses: number = 0
@ -114,7 +114,7 @@ var losses: number = 0
### Step 22
Add a condition for when button `B` is pressed. When this occurs, we will increment your losses against the micro:bit by 1. Let's hope that this button will not be pressed too often!
Add a condition for when button `B` is pressed. When this occurs, we will increment your losses against the @boardname@ by 1. Let's hope that this button will not be pressed too often!
```
wins = 0
@ -167,7 +167,7 @@ input.onButtonPressed(Button.B, () => {
### Step 24
Let's also display the score when button `B` is pressed, just as we have done for button `A`. This will help us keep track of the number of wins and losses you have against the micro:bit.
Let's also display the score when button `B` is pressed, just as we have done for button `A`. This will help us keep track of the number of wins and losses you have against the @boardname@.
```
wins = 0
@ -198,7 +198,7 @@ input.onButtonPressed(Button.B, () => {
### Step 25
You have managed to keep track of both the wins and losses you have against the micro:bit! But did you notice that you haven't updated something? Take a look at condition of `input->on button pressed("A")`.
You have managed to keep track of both the wins and losses you have against the @boardname@! But did you notice that you haven't updated something? Take a look at condition of `input->on button pressed("A")`.
```
wins = 0
@ -229,7 +229,7 @@ input.onButtonPressed(Button.B, () => {
})
```
* Tap the `run` button to run your game on the simulator. See if you can get more wins than the micro:bit can!
* Tap the `run` button to run your game on the simulator. See if you can get more wins than the @boardname@ can!
Congratulations! You have successfully created a fully functional game of rock, paper, scissors against the micro:bit. Challenge your friends to see who can get a better score against the micro:bit.
Congratulations! You have successfully created a fully functional game of rock, paper, scissors against the @boardname@. Challenge your friends to see who can get a better score against the @boardname@.

View File

@ -4,7 +4,7 @@ My script. #docs
**Challenge 0**
Great job! You have successfully completed the [Running Time tutorial](/lessons/running-time/tutorial) . You have a forever loop that declares a variable in it that holds the running time in milliseconds of the micro:bit and then shows the seconds on the LED screen.
Great job! You have successfully completed the [Running Time tutorial](/lessons/running-time/tutorial) . You have a forever loop that declares a variable in it that holds the running time in milliseconds of the @boardname@ and then shows the seconds on the LED screen.
```
basic.forever(() => {

View File

@ -20,7 +20,7 @@ input.onScreenUp(() => {
**Challenge 1**
Now have the Micro:bit do something when the screen is moved downward. You can do this by calling the on screen down method. Do not do anything when you call the on screen down method.
Now have the @boardname@ do something when the screen is moved downward. You can do this by calling the on screen down method. Do not do anything when you call the on screen down method.
```
input.onScreenUp(() => {
@ -39,7 +39,7 @@ input.onScreenDown(() => {
**Challenge 2**
When the Micro:bit is moved downward, create and show an image of an upside down heart.
When the @boardname@ is moved downward, create and show an image of an upside down heart.
```
input.onScreenUp(() => {

View File

@ -1,10 +1,10 @@
# set brightness challenges
These challenges will allow you to change the brightness of the micro:bit. docs
These challenges will allow you to change the brightness of the @boardname@. docs
**Challenge 0**
[This tutorial](/lessons/set-brightness/tutorial) will show you how to set the brightness on the micro:bit.
[This tutorial](/lessons/set-brightness/tutorial) will show you how to set the brightness on the @boardname@.
```
led.setBrightness(255)

View File

@ -4,7 +4,7 @@ My script. #docs
**Challenge 0**
Welcome! This [guided tutorial](/pxjkww) introduces the basic show string method on the micro:bit.
Welcome! This [guided tutorial](/pxjkww) introduces the basic show string method on the @boardname@.
Let's show the string 'Hello' on the LED screen. The string will scroll one character at a time from left to right.

View File

@ -76,5 +76,5 @@ input.onGesture(Gesture.Shake, () => {
**Challenge 3**
Give Micro a nickname and display it on the micro:bit!
Give Micro a nickname and display it on the @boardname@!

View File

@ -51,7 +51,7 @@ while (count > 0) {
**Challenge 3**
Now, we need `count` to decrease by one after the micro:bit has displayed the value of `count`.
Now, we need `count` to decrease by one after the @boardname@ has displayed the value of `count`.
We can do this by adding this line:

View File

@ -4,7 +4,7 @@ My script. #docs
**Challenge 0**
This [guided tutorial](/lessons/yes-no/challenges) will show you how to display text on the micro:bit!
This [guided tutorial](/lessons/yes-no/challenges) will show you how to display text on the @boardname@!
```
basic.showString("ASK ME A QUESTION", 150)

View File

@ -25,7 +25,7 @@ To add a library to a script:
Once you've added a library to your script, you can use any of the library's non-private [functions](/js/function). Here's how:
* on the [Code Keyboard](/js/editor) click the button with the library's name (for example, `micro:bit` and `micro:bit game` are library buttons). The functions in the library have a button on the Code Keyboard.
* on the [Code Keyboard](/js/editor) click the button with the library's name (for example, `@boardname@` and `@boardname@ game` are library buttons). The functions in the library have a button on the Code Keyboard.
### Create a library

View File

@ -1,6 +1,6 @@
# micro:bit
# @boardname@
The micro:bit device api. #microbit
The @boardname@ device api. #microbit
Initialize the library.

View File

@ -1,6 +1,6 @@
# Objects disclaimer
Touch Develop docs for the micro:bit.
Touch Develop docs for the @boardname@.
### Memory management on the micro-bit

View File

@ -1,6 +1,6 @@
# Custom object types
Touch Develop docs for the micro:bit.
Touch Develop docs for the @boardname@.
### What is an object?

View File

@ -1,4 +1,4 @@
# micro:bit orientation
# @boardname@ orientation
A #microbit library that exposes accelerometer events.

View File

@ -28,7 +28,7 @@ The currently available on-line resources from the Quick Start Guide are the
### How does my program get onto the @boardname@?
For your program to work on the @boardname@, first it has to be compiled. Compiling means to translate a program into a more efficient computer language. When you hit the compile button on the Microsoft Touch Develop Editor interface, your program is compiled into a hex file that contains the machine code in the instruction set used by the ARM processor that is on your @boardname@. Compiling to ARM machine code actually happens in the web browser, where the code from script is joined with the machine code of the micro:bit runtime.
For your program to work on the @boardname@, first it has to be compiled. Compiling means to translate a program into a more efficient computer language. When you hit the compile button on the Microsoft Touch Develop Editor interface, your program is compiled into a hex file that contains the machine code in the instruction set used by the ARM processor that is on your @boardname@. Compiling to ARM machine code actually happens in the web browser, where the code from script is joined with the machine code of the @boardname@ runtime.
![](/static/mb/quick-start-0.png)

View File

@ -88,7 +88,7 @@ queues a `forever` loop for later execution by the scheduler; the body of this l
The function ends after the execution of these three statements, but this is not the end of program execution! Thats because the function queued the `forever` loop for execution by the scheduler.
The second job of the scheduler is to periodically interrupt execution to read (poll) the various inputs to the micro:bit (the buttons, pins, etc.) and fire off events (such as “button A pressed”). Recall that the firing of an event causes the event handler subprogram associated with that event to be queued for later execution. The scheduler uses a timer built into the micro:bit hardware to interrupt execution every 6 milliseconds and poll the inputs, which is more than fast enough to catch the quickest press of a button.
The second job of the scheduler is to periodically interrupt execution to read (poll) the various inputs to the @boardname@ (the buttons, pins, etc.) and fire off events (such as “button A pressed”). Recall that the firing of an event causes the event handler subprogram associated with that event to be queued for later execution. The scheduler uses a timer built into the @boardname@ hardware to interrupt execution every 6 milliseconds and poll the inputs, which is more than fast enough to catch the quickest press of a button.
### Cooperative passing of control
@ -104,7 +104,7 @@ Lets take a look at the implementation of the `forever` statement to see an e
![](/static/mb/device/reactive-2.png)
The `forever` loop actually is a function that takes a subprogram (an *Action* in Touch Develop) as a parameter. The function uses the `control -> in background` function of the micro:bit runtime to queue a `while true` loop for execution by the scheduler. The while loop has two statements. The first statement runs the subprogram represented by the `body` parameter. The second statement passes control to the scheduler (requesting to “sleep” for 20 milliseconds).
The `forever` loop actually is a function that takes a subprogram (an *Action* in Touch Develop) as a parameter. The function uses the `control -> in background` function of the @boardname@ runtime to queue a `while true` loop for execution by the scheduler. The while loop has two statements. The first statement runs the subprogram represented by the `body` parameter. The second statement passes control to the scheduler (requesting to “sleep” for 20 milliseconds).
Though the `while true` loop will repeatedly execute the body subprogram, between each execution of the body it will permit the scheduler to execute other subprograms. If the while loop did not contain the call to `pause`, then once control passed into the while loop, it would never pass back to the scheduler and no other subprogram would be able to execute (unless the body subprogram contained a call to `pause` itself).
@ -130,7 +130,7 @@ While "Show 0" (the blue sequence) is running, periodic interrupts by the schedu
Through this example, we have seen that the @boardname@ scheduler enables you to create a program that is composed of concurrent subprograms. In essence, the programmer needs to only think about the concurrent subprograms cooperatively passing control back to the scheduler, making sure no subprogram hogs control (or “dribbles the ball without passing”) for too long. While a subprogram runs, the scheduler polls the buttons and other IO peripherals at a high frequency in order to fire off events and queue event handlers for later execution, but this is invisible to the programmer.
As a result, you can easily add a new capability to the micro:bit by just adding a new subprogram. For example, if you want to add a reset feature to the counter program, all you need to do is add a new event handler for a press of button B that sets the global variable "count" to zero, as shown below:
As a result, you can easily add a new capability to the @boardname@ by just adding a new subprogram. For example, if you want to add a reset feature to the counter program, all you need to do is add a new event handler for a press of button B that sets the global variable "count" to zero, as shown below:
```
export function countButtonPressesWithReset() {

View File

@ -1,4 +1,4 @@
# micro:bit senses
# @boardname@ senses
A #microbit library that exposes orientation and movement events.

View File

@ -2,7 +2,7 @@
The serial library #docs
The **serial library** supports [serial communication](https://en.wikipedia.org/wiki/Serial_port) between the @boardname@ and another computer. Basically, this allows you to send data from the micro:bit to your own computer. This is very useful for debugging purposes: you can add `write line` statements in your code and see them display on your computer as the program executes.
The **serial library** supports [serial communication](https://en.wikipedia.org/wiki/Serial_port) between the @boardname@ and another computer. Basically, this allows you to send data from the @boardname@ to your own computer. This is very useful for debugging purposes: you can add `write line` statements in your code and see them display on your computer as the program executes.
The code below shows a simple script that sends a line when the @boardname@ starts and another line each time the button ``A`` is pressed.
@ -13,18 +13,18 @@ input.onButtonPressed(Button.A, () => {
})
```
## How to read the micro:bit's serial output from your computer
## How to read the @boardname@'s serial output from your computer
Unfortunately, using the serial library requires quite a bit of a setup.
### Windows
You must install a device driver (for the computer to recognize the serial interface of the micro:bit); then, you must also install a terminal emulator (which is going to connect to the micro:bit and read its output). Here's how to do it:
You must install a device driver (for the computer to recognize the serial interface of the @boardname@); then, you must also install a terminal emulator (which is going to connect to the @boardname@ and read its output). Here's how to do it:
* Follow instructions at https://developer.mbed.org/handbook/Windows-serial-configuration in order to install the device driver
* Install a terminal emulator; we recommend [Tera Term](https://ttssh2.osdn.jp/index.html.en). At the time of this writing, the latest version is 4.88 and can be downloaded [from here](http://en.osdn.jp/frs/redir.php?m=jaist&f=%2Fttssh2%2F63767%2Fteraterm-4.88.exe). Follow the instructions from the installer.
Once both the driver and the terminal emulator are installed, plug in the micro:bit and wait until the device is fully setup. Then, open TeraTerm.
Once both the driver and the terminal emulator are installed, plug in the @boardname@ and wait until the device is fully setup. Then, open TeraTerm.
* Hit `File` > `New Connection`
* Check "Serial"; in the dropdown menu, pick the COM port that says "mbed Serial Port". Hit `Ok`.
@ -32,7 +32,7 @@ Once both the driver and the terminal emulator are installed, plug in the micro:
You should be good. Feel free to hit `Setup` > `Save Setup` in the menus to erase the default configuration file with a new one so that you don't have to type in the settings again.
Please note that Windows will assign you a different COM port if you plug in another micro:bit. If you're juggling between micro:bits, you'll have to change the COM port every time.
Please note that Windows will assign you a different COM port if you plug in another @boardname@. If you're juggling between @boardname@s, you'll have to change the COM port every time.
### Alternative Windows setup with Putty
@ -51,27 +51,27 @@ If you prefer another terminal emulator (such as [PuTTY](http://www.putty.org/))
(Untested).
* Plug in the micro:bit
* Plug in the @boardname@
* Open a terminal
* `dmesg | tail` will show you which `/dev/` node the micro:bit was assigned (e.g. `/dev/ttyUSB0`)
* `dmesg | tail` will show you which `/dev/` node the @boardname@ was assigned (e.g. `/dev/ttyUSB0`)
* Then, do: `screen /dev/ttyUSB0 115200` (install the `screen` program if you don't have it). To exit, run `Ctrl-A` `Ctrl-D`.
Alternative programs include minicom, etc.
### Mac OS
* Plug in the micro:bit
* Plug in the @boardname@
* Open a terminal
* `ls /dev/cu.*` will return to you a list of serial devices; one of them will look like `/dev/cu.usbmodem1422` (the exact number depends on your computer)
* `screen /dev/cu.usbmodem1422 115200` will open up the micro:bit's serial output. To exit, hit `Ctrl-A` `Ctrl-D`.
* `screen /dev/cu.usbmodem1422 115200` will open up the @boardname@'s serial output. To exit, hit `Ctrl-A` `Ctrl-D`.
## Using the serial library in your programs
If the ``serial`` button is not available, you will need first to add the ``micro:bit serial`` library to your script:
If the ``serial`` button is not available, you will need first to add the ``@boardname@ serial`` library to your script:
* tap on `add new`
* tap on `library`
* select `micro:bit serial`
* select `@boardname@ serial`
### Writing data
@ -95,7 +95,7 @@ serial.writeString("hello")
serial.writeLine("this is a line")
```
Theoretically, you can dump more sophisticated data and then read it back in the event that two micro:bits should be connected to each other over serial. We have not tested this scenario yet as we have yet to expose functionality that allows re-routing the serial ports to the edge connector.
Theoretically, you can dump more sophisticated data and then read it back in the event that two @boardname@s should be connected to each other over serial. We have not tested this scenario yet as we have yet to expose functionality that allows re-routing the serial ports to the edge connector.
* write an image

View File

@ -23,7 +23,7 @@ The @boardname@ simulator supports the Touch Develop [functions](/js/contents) a
* **LED screen**: the [LED screen](/device/screen) that appears on-screen shows you what you'll see on the @boardname@ device
* **input buttons**: when running code with [button is pressed](/reference/input/button-is-pressed) or [on button pressed](/reference/input/on-button-pressed) functions, click the on-screen A or B button
* **compass**: when running code that includes [compass heading](/reference/input/compass-heading), click and drag the on-screen compass needle to change the heading
* **accelerometer**: move your mouse over the on-screen micro:bit device to simulate [acceleration](/reference/input/acceleration). The x and y axis values are shown on-screen.
* **accelerometer**: move your mouse over the on-screen @boardname@ device to simulate [acceleration](/reference/input/acceleration). The x and y axis values are shown on-screen.
* **digital pins**: you can click the on-screen digital pins (0 , 1, or 2) to turn them on or off (see [digital write pin](/reference/pins/digital-write-pin) and [digital read pin](/reference/pins/digital-read-pin) for more info).
**Can't see the red LEDs on the simulator?**
@ -32,13 +32,13 @@ If you click on the white THEME button in the top right corner of the simulator,
### All done?
Once you're done writing and testing your code on the simulator, compile and run your script on your @boardname@ device. To find out how to do this, see [run scripts on the micro:bit](/device/usb).
Once you're done writing and testing your code on the simulator, compile and run your script on your @boardname@ device. To find out how to do this, see [run scripts on the @boardname@](/device/usb).
### Simulator vs micro:bit
### Simulator vs @boardname@
Running your scripts in a web browser is a *simulation* of how your code will run on the @boardname@ device. When you run your script on your @boardname@ device, the results may differ slightly. For example, the timing may be subtly different when your script runs on the @boardname@ device (you may need to adjust your [pause](/reference/basic/pause) functions). For this reason, be sure to test your scripts on the @boardname@ device.
### See also
[run scripts on the micro:bit](/device/usb), [Microsoft Block editor](/blocks/editor), [Touch Develop editor](/js/editor)
[run scripts on the @boardname@](/device/usb), [Microsoft Block editor](/blocks/editor), [Touch Develop editor](/js/editor)

View File

@ -32,7 +32,7 @@ TouchDevelop operators include:
Libraries provide additional functions:
* the [micro:bit library](/js/contents)
* the [@boardname@ library](/js/contents)
* the [math](/js/math) and [bits](/js/bits) libraries
### see also

View File

@ -34,7 +34,7 @@ let salutation = "Hello"
### The function `show string`
Use [show string](/reference/basic/show-string) to display a string on the [LED screen](/device/screen). If the string is multiple characters, the string scrolls right to left. The following example displays `Hello world!` on the micro:bit screen:
Use [show string](/reference/basic/show-string) to display a string on the [LED screen](/device/screen). If the string is multiple characters, the string scrolls right to left. The following example displays `Hello world!` on the @boardname@ screen:
```
basic.showString("Hello world!", 100)

View File

@ -10,7 +10,7 @@ A *type* refers to a class of data and the operations permitted on that data. Th
* **[String](/reference/types/string)**: a sequence of characters
* **[Number](/reference/types/number)**: an integer number (32-bit signed)
* **[Boolean](/reference/types/boolean)**: true or false
* **[Image](/reference/image/image)**: a collection of [micro:bit LED states](/device/screen) (on/off)
* **[Image](/reference/image/image)**: a collection of [@boardname@ LED states](/device/screen) (on/off)
* *more types coming!!!*
### see also