inserting macros instead of hard coded board names
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
# In-browser compiler
|
||||
|
||||
The BBC micro:bit pins.
|
||||
The @boardname@ pins.
|
||||
|
||||
## We listened to your feedback!
|
||||
|
||||
@ -12,7 +12,7 @@ Following the feedback from teachers, the following improvements were made:
|
||||
|
||||
## A new in-browser compiler
|
||||
|
||||
The compilation from a script to ARM machine code is now done entirely in the browser (read the [in depth story](https://www.touchdevelop.com/docs/touch-develop-in-208-bits) about building the compiler). The new compiler is used by the Block Editor, Touch Develop and Code Kingdoms to create a .hex file solely within the confines of your web browser (no Internet connection is needed). The BBC micro:bit compilation process (see page 10 in the Quick Start book) has been updated below to reflect the new compiler architecture, shown below.
|
||||
The compilation from a script to ARM machine code is now done entirely in the browser (read the [in depth story](https://www.touchdevelop.com/docs/touch-develop-in-208-bits) about building the compiler). The new compiler is used by the Block Editor, Touch Develop and Code Kingdoms to create a .hex file solely within the confines of your web browser (no Internet connection is needed). The @boardname@ compilation process (see page 10 in the Quick Start book) has been updated below to reflect the new compiler architecture, shown below.
|
||||
|
||||

|
||||
|
||||
@ -22,7 +22,7 @@ The C++ compiler now only is used to compile the micro:bit runtime - this is don
|
||||
|
||||

|
||||
|
||||
The BBC micro:bit automatically saves and synchronizes scripts for signed in users through the cloud. Unfortunately, this scenario would not work always so we decided to also support files. Users are now able to import and export scripts as files. For example, they can simply email it or submit them in their classroom portal.
|
||||
The @boardname@ automatically saves and synchronizes scripts for signed in users through the cloud. Unfortunately, this scenario would not work always so we decided to also support files. Users are now able to import and export scripts as files. For example, they can simply email it or submit them in their classroom portal.
|
||||
|
||||

|
||||
|
||||
|
@ -14,10 +14,10 @@ JavaScript docs for the micro:bit
|
||||
|
||||
### ~
|
||||
|
||||
Welcome to the Touch Develop home page for the BBC micro:bit. Below you will find resources about the Touch Develop programming language and code editor. Good places to start include:
|
||||
Welcome to the Touch Develop home page for the @boardname@. Below you will find resources about the Touch Develop programming language and code editor. Good places to start include:
|
||||
|
||||
* [the Touch Develop Editor](/js/editor)
|
||||
* [30+ BBC micro:bit lessons](/lessonss)
|
||||
* [30+ @boardname@ lessons](/lessonss)
|
||||
* [offline support](/offline)
|
||||
|
||||
### ~column
|
||||
@ -92,7 +92,7 @@ Welcome to the Touch Develop home page for the BBC micro:bit. Below you will fin
|
||||
|
||||
### ~column
|
||||
|
||||
## BBC micro:bit functions
|
||||
## @boardname@ functions
|
||||
|
||||
### Basic
|
||||
|
||||
@ -190,7 +190,7 @@ Functions in this category require to be connected to a remote device.
|
||||
## Run
|
||||
|
||||
* [scripts in the browser](/js/simulator)
|
||||
* [scripts on your BBC micro:bit](/device/usb)
|
||||
* [scripts on your @boardname@](/device/usb)
|
||||
|
||||
## Debugging
|
||||
|
||||
|
@ -51,7 +51,7 @@ input.onButtonPressed(Button.A, () => {
|
||||
|
||||
### 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
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Events Library
|
||||
|
||||
The functions in the events namespace allow the BBC micro:bit to communicate with a separate (remote) device, 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 events accessible from Touch Develop are listed below.
|
||||
The functions in the events namespace allow the @boardname@ to communicate with a separate (remote) device, such as a smartphone, over Bluetooth (Smart). The set of supported events will depend on the remote device and the @boardname@ apps available for the remote device. The events accessible from Touch Develop are listed below.
|
||||
|
||||
### Remote control
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Gallery
|
||||
|
||||
Overview of Touch Develop lessons for the BBC micro:bit.
|
||||
Overview of Touch Develop lessons for the @boardname@.
|
||||
|
||||
### @short Gallery
|
||||
|
||||
@ -9,13 +9,13 @@ Overview of Touch Develop lessons for the BBC micro:bit.
|
||||
|
||||
## Maker
|
||||
|
||||
* [Telegraph](/pzeagwoudd), play the telegraph game between 2 BBC micro:bits
|
||||
* [Ornament Chain](/rnvpgo), play the ornament chain game between 2 BBC micro:bits
|
||||
* [Telegraph](/pzeagwoudd), play the telegraph game between 2 @boardname@s
|
||||
* [Ornament Chain](/rnvpgo), play the ornament chain game between 2 @boardname@s
|
||||
|
||||
### ~hide
|
||||
|
||||
* [The Watch](/lessons/the-watch), design and create The Watch
|
||||
* [Hack your headphones](/lessons/hack-your-headphones), create music on the BBC micro:bit by hacking your headphones
|
||||
* [Hack your headphones](/lessons/hack-your-headphones), create music on the @boardname@ by hacking your headphones
|
||||
* [Banana Keyboard](/lessons/banana-keyboard), create music with fruits
|
||||
|
||||
### ~
|
||||
@ -51,7 +51,7 @@ Overview of Touch Develop lessons for the BBC micro:bit.
|
||||
* [Truth or dare](/filuzbwauo), a game that forces each player to reveal a secret or do something funny with if statement
|
||||
* [Love meter](/rrmlrvojfa), create a love meter with on pin pressed
|
||||
* [Guess the number](/ftsenbvqwz), guess a random number with random
|
||||
* [Magic 8](/fyjinpjuqu), a fortune teller game with the BBC micro:bit
|
||||
* [Magic 8](/fyjinpjuqu), a fortune teller game with the @boardname@
|
||||
* [Counter](/rerlmjgjut), display a number with a variable
|
||||
* [Glowing pendulum](/xrnsveuwxj), construct a pendulum that glows using acceleration
|
||||
* [Looper](/nxcddtbizi), display a series of numbers with a for loop index
|
||||
@ -60,7 +60,7 @@ Overview of Touch Develop lessons for the BBC micro:bit.
|
||||
|
||||
* [Rotation animation](/lessons/rotation-animation), control an animation with a boolean variable
|
||||
* [Offset image](/lessons/offset-image), shift an image horizontally with image offset
|
||||
* [Compass](/lessons/compass), displays the direction the BBC micro:bit is pointing
|
||||
* [Compass](/lessons/compass), displays the direction the @boardname@ is pointing
|
||||
|
||||
### ~
|
||||
|
||||
@ -74,7 +74,7 @@ Overview of Touch Develop lessons for the BBC micro:bit.
|
||||
* [Headbands](/bzrusu), create a charades game with a collection of strings that hold the words
|
||||
* [Prank WiFi](/dceikq), create fake WiFi to trick your friends
|
||||
* [Flipping bird](/lbhvywjzkv), use modulo with a conditional
|
||||
* [Runaway pac man](/loafab), construct the game pac man with the BBC micro:bit
|
||||
* [Runaway pac man](/loafab), construct the game pac man with the @boardname@
|
||||
* [Line of Fire](/fzcoly), make a game to test hand-eye coordination
|
||||
* [The hat game](/njynsd), make a game to test your focus on the moving ball
|
||||
* [Pong](/xcenyy), a light bouncing from left to right
|
||||
@ -89,13 +89,13 @@ Overview of Touch Develop lessons for the BBC micro:bit.
|
||||
* [Transformers](/lessons/transformers), use functions to return values
|
||||
* [Speed button](/lessons/speed-button), code a speed game with running time
|
||||
* [Jailbreak](/lessons/jailbreak), break out of a counting loop by pressing button "A"
|
||||
* [2 player pong](/bzycll), collaborate with a classmate to develop Pong on multiple BBC micro:bits
|
||||
* [2 player pong](/bzycll), collaborate with a classmate to develop Pong on multiple @boardname@s
|
||||
|
||||
### ~
|
||||
|
||||
### ~hide
|
||||
|
||||
* [Number psych](/lessons/number-psych), collaborate with multiple classmates to develop a game on multiple BBC micro:bits and a breadboard
|
||||
* [Number psych](/lessons/number-psych), collaborate with multiple classmates to develop a game on multiple @boardname@s and a breadboard
|
||||
|
||||
### ~
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Game Tutorials
|
||||
|
||||
Overview of Games for the BBC micro:bit.
|
||||
Overview of Games for the @boardname@.
|
||||
|
||||
### @short Games
|
||||
|
||||
@ -41,8 +41,8 @@ Overview of Games for the BBC micro:bit.
|
||||
* [Looper](/lessons/looper/tutorial), display a series of numbers with a for loop index
|
||||
* [Strobe light](/lessons/strobe-light/tutorial), develop shapes with a nested for loops
|
||||
* [Digi yoyo](/lessons/digi-yoyo/tutorial), create a counter with a while loop
|
||||
* [Magic 8](/lessons/magic-8/tutorial), a fortune teller game with the BBC micro:bit
|
||||
* [Compass](/lessons/compass/tutorial), displays the direction the BBC micro:bit is pointing
|
||||
* [Magic 8](/lessons/magic-8/tutorial), a fortune teller game with the @boardname@
|
||||
* [Compass](/lessons/compass/tutorial), displays the direction the @boardname@ is pointing
|
||||
* [Speed button](/lessons/speed-button/tutorial), code a speed game with running time
|
||||
|
||||
### ~hide
|
||||
@ -74,15 +74,15 @@ Overview of Games for the BBC micro:bit.
|
||||
* [Bop it](/lessons/bop-it/tutorial), a game where you have to keep up with the commands
|
||||
* [Letter Up](/lessons/letter-up/tutorial), a guessing game with string operators with string at
|
||||
* [Prank WiFi](/lessons/prank-wifi/tutorial), create fake WiFi to trick your friends
|
||||
* [Runaway pac man](/lessons/runaway-pacman/tutorial), construct the game pac man with the BBC micro:bit
|
||||
* [Runaway pac man](/lessons/runaway-pacman/tutorial), construct the game pac man with the @boardname@
|
||||
* [The hat game](/lessons/the-hat-game/tutorial), make a game to test your focus on the moving ball
|
||||
* [2 player pong](/lessons/2-player-pong/tutorial), collaborate with a classmate to develop Pong on multiple BBC micro:bits
|
||||
* [2 player pong](/lessons/2-player-pong/tutorial), collaborate with a classmate to develop Pong on multiple @boardname@s
|
||||
|
||||
### ~hide
|
||||
|
||||
* [Glowing pendulum](/lessons/glowing-pendulum/tutorial), construct a pendulum that glows using acceleration
|
||||
* [Line of Fire](/lessons/line-of-fire/tutorial), make a game to test hand-eye coordination
|
||||
* [Number psych](/lessons/number-psych/tutorial), collaborate with multiple classmates to develop a game on multiple BBC micro:bits and a breadboard
|
||||
* [Number psych](/lessons/number-psych/tutorial), collaborate with multiple classmates to develop a game on multiple @boardname@s and a breadboard
|
||||
|
||||
### ~
|
||||
|
||||
|
@ -1,14 +1,14 @@
|
||||
# Hour of Code
|
||||
|
||||
learn how to run an Hour Of Code with the BBC micro:bit. #docs
|
||||
learn how to run an Hour Of Code with the @boardname@. #docs
|
||||
|
||||
The BBC micro:bit can be used to run an Hour Of Code™ events for beginner of all ages. This document provides a detailed guidance on how to prepare and deliver the event in your school.
|
||||
The @boardname@ can be used to run an Hour Of Code™ events for beginner of all ages. This document provides a detailed guidance on how to prepare and deliver the event in your school.
|
||||
|
||||
## preparing the room
|
||||
|
||||
1) Computers
|
||||
|
||||
* Ensure that each participant will have **a computer connected to a BBC micro:bit board via a micro-USB cable**.
|
||||
* Ensure that each participant will have **a computer connected to a @boardname@ board via a micro-USB cable**.
|
||||
|
||||
2) Internet
|
||||
|
||||
@ -53,8 +53,8 @@ Print the following **challenges** (1 handout per student):
|
||||
|
||||
After your Hour Of Code™, you will want to provide plenty of material for students to continue learning about coding. Here are some good places to start:
|
||||
|
||||
* [more challenges](/js/games) are available with BBC micro:bit Tutorials
|
||||
* [the Quick Start Guide for Teachers](http://www.slideshare.net/Microsofteduk/bbc-microbit-guide-from-hodder-education) are available within BBC micro:bit
|
||||
* [more challenges](/js/games) are available with @boardname@ Tutorials
|
||||
* [the Quick Start Guide for Teachers](http://www.slideshare.net/Microsofteduk/bbc-microbit-guide-from-hodder-education) are available within @boardname@
|
||||
|
||||
The 'Hour of Code™' is a nationwide initiative by [Computer Science Education Week](http://csedweek.org) and [Code.org](http://code.org) to introduce millions of students to one hour of computer science and computer programming.
|
||||
|
||||
|
@ -1,14 +1,14 @@
|
||||
# Hour of Code notes
|
||||
|
||||
learn how to run an Hour Of Code with the BBC micro:bit. #docs
|
||||
learn how to run an Hour Of Code with the @boardname@. #docs
|
||||
|
||||
The BBC micro:bit can be used to run an Hour Of Code™ event for beginner of all ages. This document provides a detailed guidance on how to prepare and deliver the event in your school.
|
||||
The @boardname@ can be used to run an Hour Of Code™ event for beginner of all ages. This document provides a detailed guidance on how to prepare and deliver the event in your school.
|
||||
|
||||
## Preparation
|
||||
|
||||
1) Computers
|
||||
|
||||
Each participant has **a computer connected to a BBC micro:bit via micro-USB**.
|
||||
Each participant has **a computer connected to a @boardname@ via micro-USB**.
|
||||
|
||||
2) Internet
|
||||
|
||||
@ -41,8 +41,8 @@ Bring more energy in the room by playing music.
|
||||
|
||||
After your Hour Of Code™, you will want to provide plenty of material for students to continue learning about coding. Here are some good places to start:
|
||||
|
||||
* [more challenges](/lessonss) are available for BBC micro:bit
|
||||
* [the Quick Start Guide for Teachers](http://www.slideshare.net/Microsofteduk/bbc-microbit-guide-from-hodder-education) are available within BBC micro:bit
|
||||
* [more challenges](/lessonss) are available for @boardname@
|
||||
* [the Quick Start Guide for Teachers](http://www.slideshare.net/Microsofteduk/bbc-microbit-guide-from-hodder-education) are available within @boardname@
|
||||
|
||||
_The Hour of Code™ is a nationwide initiative by [Computer Science Education Week](http://csedweek.org) and [Code.org](http://code.org) to introduce millions of students to one hour of computer science and computer programming._
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Touch Develop Lessons
|
||||
|
||||
Overview of Touch Develop lessons for the BBC micro:bit.
|
||||
Overview of Touch Develop lessons for the @boardname@.
|
||||
|
||||
### @short Lessons
|
||||
|
||||
@ -9,10 +9,10 @@ Overview of Touch Develop lessons for the BBC micro:bit.
|
||||
## Maker
|
||||
|
||||
* [The Watch](/lessons/the-watch), design and create The Watch
|
||||
* [Hack your Headphones](/lessons/hack-your-headphones), create music on the BBC micro:bit by hacking your headphones
|
||||
* [Hack your Headphones](/lessons/hack-your-headphones), create music on the @boardname@ by hacking your headphones
|
||||
* [Banana Keyboard](/lessons/banana-keyboard), create music with fruits
|
||||
* [Telegraph](/lessons/telegraph), play the telegraph game between 2 BBC micro:bits
|
||||
* [Ornament Chain](/lessons/ornament-chain), play the ornament chain game between 2 BBC micro:bits
|
||||
* [Telegraph](/lessons/telegraph), play the telegraph game between 2 @boardname@s
|
||||
* [Ornament Chain](/lessons/ornament-chain), play the ornament chain game between 2 @boardname@s
|
||||
|
||||
## Beginner
|
||||
|
||||
@ -33,7 +33,7 @@ Overview of Touch Develop lessons for the BBC micro:bit.
|
||||
|
||||
## 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 random
|
||||
* [Rock Paper Scissors](/lessons/rock-paper-scissors), use image offsets with local variables
|
||||
* [Counter](/lessons/counter), display a number with a variable
|
||||
@ -48,7 +48,7 @@ Overview of Touch Develop lessons for the BBC micro:bit.
|
||||
* [Digi Yoyo](/lessons/digi-yoyo), create a counter with a while loop
|
||||
* [Rotation Animation](/lessons/rotation-animation), control an animation with a boolean variable
|
||||
* [Offset Image](/lessons/offset-image), shift an image horizontally with image offset
|
||||
* [Compass](/lessons/compass), displays the direction the BBC micro:bit is pointing
|
||||
* [Compass](/lessons/compass), displays the direction the @boardname@ is pointing
|
||||
|
||||
### ~
|
||||
|
||||
@ -64,10 +64,10 @@ Overview of Touch Develop lessons for the BBC micro:bit.
|
||||
* [Prank WiFi](/lessons/prank-wifi), create fake WiFi to trick your friends
|
||||
* [Jailbreak](/lessons/jailbreak), break out of a counting loop by pressing button "A"
|
||||
* [Flipping Bird](/lessons/flipping-bird), use modulo with a conditional
|
||||
* [Runaway Pac Man](/lessons/runaway-pacman), construct the game pac man with the BBC micro:bit
|
||||
* [Runaway Pac Man](/lessons/runaway-pacman), construct the game pac man with the @boardname@
|
||||
* [Line of Fire](/lessons/line-of-fire), make a game to test hand-eye coordination
|
||||
* [The Hat Game](/lessons/the-hat-game), make a game to test your focus on the moving ball
|
||||
* [2 Player Pong](/lessons/2-player-pong), collaborate with a classmate to develop Pong on multiple BBC micro:bits
|
||||
* [2 Player Pong](/lessons/2-player-pong), collaborate with a classmate to develop Pong on multiple @boardname@s
|
||||
|
||||
### Games
|
||||
|
||||
@ -81,7 +81,7 @@ Overview of Touch Develop lessons for the BBC micro:bit.
|
||||
|
||||
### ~hide
|
||||
|
||||
* [Number Psych](/lessons/number-psych), collaborate with multiple classmates to develop a game on multiple BBC micro:bits and a breadboard
|
||||
* [Number Psych](/lessons/number-psych), collaborate with multiple classmates to develop a game on multiple @boardname@s and a breadboard
|
||||
|
||||
### ~
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
# 2 player pong quiz answers
|
||||
|
||||
a two-player game of Pong using TWO BBC micro:bits!.
|
||||
a two-player game of Pong using TWO @boardname@s!.
|
||||
|
||||
## Name
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
# 2 player pong quiz
|
||||
|
||||
a two-player game of Pong using TWO BBC micro:bits!.
|
||||
a two-player game of Pong using TWO @boardname@s!.
|
||||
|
||||
## Name
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
# digital pet lesson
|
||||
|
||||
a display of pet images for the BBC micro:bit.
|
||||
a display of pet images for the @boardname@.
|
||||
|
||||
## Topic
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
# digital pet quiz answers
|
||||
|
||||
A display of pet images for the BBC micro:bit
|
||||
A display of pet images for the @boardname@
|
||||
|
||||
## Name
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
# digital pet quiz
|
||||
|
||||
A display of pet images for the BBC micro:bit
|
||||
A display of pet images for the @boardname@
|
||||
|
||||
## Name
|
||||
|
||||
|
@ -12,7 +12,7 @@ Modulo (or Mod) is the remainder of a division problem.
|
||||
|
||||
## 2. Consider the following code
|
||||
|
||||
If the rectangle below represents the BBC micro:bit, shade in the LEDs that show the value being stored into the **global variable**, `count`. Explain why that particular area is shaded.
|
||||
If the rectangle below represents the @boardname@, shade in the LEDs that show the value being stored into the **global variable**, `count`. Explain why that particular area is shaded.
|
||||
|
||||
```
|
||||
count = 1
|
||||
@ -38,7 +38,7 @@ count = 12
|
||||
count = math.mod(count, 5)
|
||||
```
|
||||
|
||||
If the rectangle below represents the BBC micro:bit, shade in the LEDs that show the value being stored into the **global variable**, `count`. Explain why that particular area is shaded.
|
||||
If the rectangle below represents the @boardname@, shade in the LEDs that show the value being stored into the **global variable**, `count`. Explain why that particular area is shaded.
|
||||
|
||||
<br/>
|
||||
|
||||
|
@ -14,7 +14,7 @@ Answer the questions while completing the tutorial. Pay attention to the dialogu
|
||||
|
||||
## 2. Consider the following directions
|
||||
|
||||
If the rectangle below represents the BBC micro:bit, shade in the LEDs that show the value being stored into the **global variable**, `count`.
|
||||
If the rectangle below represents the @boardname@, shade in the LEDs that show the value being stored into the **global variable**, `count`.
|
||||
|
||||
```
|
||||
count = 1
|
||||
@ -28,7 +28,7 @@ count = 1
|
||||
|
||||
## 3. Consider the following code
|
||||
|
||||
If the rectangle below represents the BBC micro:bit, shade in the LEDs that show the value being stored into the **global variable**, `count`. Explain why that particular area is shaded.
|
||||
If the rectangle below represents the @boardname@, shade in the LEDs that show the value being stored into the **global variable**, `count`. Explain why that particular area is shaded.
|
||||
|
||||
```
|
||||
count = 1
|
||||
@ -50,7 +50,7 @@ count = 12
|
||||
count = math.mod(count, 5)
|
||||
```
|
||||
|
||||
If the rectangle below represents the BBC micro:bit, shade in the LEDs that show the value being stored into the **global variable**, `count`. Explain why that particular area is shaded.
|
||||
If the rectangle below represents the @boardname@, shade in the LEDs that show the value being stored into the **global variable**, `count`. Explain why that particular area is shaded.
|
||||
|
||||

|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
# hack your headphones lesson
|
||||
|
||||
display beautiful images on the BBC micro:bit.
|
||||
display beautiful images on the @boardname@.
|
||||
|
||||
## Topic
|
||||
|
||||
@ -16,9 +16,9 @@ Year 7
|
||||
|
||||
## 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, headphones (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, headphones (or speakers), as well as crocodile clips (or spring clips).
|
||||
|
||||
## Objectives
|
||||
|
||||
* learn how to setup the BBC micro:bit with headphones to play music
|
||||
* learn how to setup the @boardname@ with headphones to play music
|
||||
|
||||
|
@ -56,7 +56,7 @@ Learn how to create a guessing game with **global variables** `var str: "this is
|
||||
* learn how to show a string on the LED screen
|
||||
* learn how to create a local variable to store data so that you can use it later in your code
|
||||
* learn how to set and change the value of a local variable
|
||||
* learn how to register an event handler that executes whenever the LED screen is perpendicular to the ground and the BBC micro:bit logo is above the LED screen
|
||||
* learn how to register an event handler that executes whenever the LED screen is perpendicular to the ground and the @boardname@ logo is above the LED screen
|
||||
* learn how to register an event handler that executes whenever the LED screen is facing the floor
|
||||
* learn how to register an event handler that executes whenever the LED screen is facing the ceiling/sky
|
||||
* learn how to return a random number
|
||||
|
@ -181,7 +181,7 @@ while (true) {
|
||||
}
|
||||
```
|
||||
|
||||
## 14. Write the code that displays an "X" on the BBC micro:bit if 'result' is 1. Otherwise, display a "check mark".
|
||||
## 14. Write the code that displays an "X" on the @boardname@ if 'result' is 1. Otherwise, display a "check mark".
|
||||
|
||||
<br />
|
||||
|
||||
|
@ -108,7 +108,7 @@ Answer the questions while completing the tutorial. Pay attention to the dialogu
|
||||
|
||||
<br/>
|
||||
|
||||
## 14. Write the code that displays an "X" on the BBC micro:bit if 'result' is 1. Otherwise, display a "check mark".
|
||||
## 14. Write the code that displays an "X" on the @boardname@ if 'result' is 1. Otherwise, display a "check mark".
|
||||
|
||||
<br />
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
# screen wipe activity
|
||||
|
||||
Clear the screen by pressing buttons on the BBC micro:bit.
|
||||
Clear the screen by pressing buttons on the @boardname@.
|
||||
|
||||
### ~avatar avatar
|
||||
|
||||
This activity will teach how to clear the screen by pressing button ``A`` on the BBC micro:bit.
|
||||
This activity will teach how to clear the screen by pressing button ``A`` on the @boardname@.
|
||||
|
||||
### ~
|
||||
|
||||
@ -35,7 +35,7 @@ input.onButtonPressed(Button.A, () => {
|
||||
}) // ***
|
||||
```
|
||||
|
||||
Run the script in the simulator or on the BBC micro:bit to see how this works!
|
||||
Run the script in the simulator or on the @boardname@ to see how this works!
|
||||
|
||||
### ~avatar boothing
|
||||
|
||||
|
@ -4,7 +4,7 @@ clear the screen by pressing the "A" button after an animation has been played.
|
||||
|
||||
This is the answer key for the [screen wipe quiz](/lessons/screen-wipe/quiz).
|
||||
|
||||
## 1. What does the function "clear screen" do on the BBC micro:bit?
|
||||
## 1. What does the function "clear screen" do on the @boardname@?
|
||||
|
||||
This function turns off all the LED lights on the LED screen.
|
||||
|
||||
@ -24,7 +24,7 @@ basic.showAnimation(`
|
||||
`, 400)
|
||||
```
|
||||
|
||||
## 3. Write the condition that will detect when the BBC micro:bit is shaken.
|
||||
## 3. Write the condition that will detect when the @boardname@ is shaken.
|
||||
|
||||
<br/>
|
||||
|
||||
@ -33,7 +33,7 @@ input.onGesture(Gesture.Shake, () => {
|
||||
})
|
||||
```
|
||||
|
||||
## 4. Write the code that will clear an animation from the screen after shaking the BBC micro:bit.
|
||||
## 4. Write the code that will clear an animation from the screen after shaking the @boardname@.
|
||||
|
||||
<br/>
|
||||
|
||||
|
@ -10,7 +10,7 @@ Use this activity document to guide your work in the [screen wipe tutorial](/les
|
||||
|
||||
Answer the questions while completing the tutorial. Pay attention to the dialogues!
|
||||
|
||||
## 1. What does the function "clear screen" do on the BBC micro:bit?
|
||||
## 1. What does the function "clear screen" do on the @boardname@?
|
||||
|
||||
<br/>
|
||||
|
||||
@ -20,13 +20,13 @@ Answer the questions while completing the tutorial. Pay attention to the dialogu
|
||||
|
||||
<br/>
|
||||
|
||||
## 3. How can the BBC micro:bit detect when it is shaken?
|
||||
## 3. How can the @boardname@ detect when it is shaken?
|
||||
|
||||
<br/>
|
||||
|
||||
<br/>
|
||||
|
||||
## 4. Write the code that will clear an animation from the screen after shaking the BBC micro:bit.
|
||||
## 4. Write the code that will clear an animation from the screen after shaking the @boardname@.
|
||||
|
||||
<br/>
|
||||
|
||||
|
@ -38,7 +38,7 @@ Write the code to call the function that doubles the input number. (the function
|
||||
|
||||
## 6. Consider the following picture
|
||||
|
||||
Write the code to show number 20 on the BBC micro:bit. Please add the variable called `doubled` Refer to the finished code on the tutorial.
|
||||
Write the code to show number 20 on the @boardname@. Please add the variable called `doubled` Refer to the finished code on the tutorial.
|
||||
|
||||
<br/>
|
||||
|
||||
|
@ -24,11 +24,11 @@ The currently available on-line resources from the Quick Start Guide are the
|
||||
|
||||
### Errata
|
||||
|
||||
* compilation to the BBC micro:bit now works [off line](/offline), based on a new compiler in the web browser. The text and picture below replaces the text and picture on page 10 of the Guide:
|
||||
* compilation to the @boardname@ now works [off line](/offline), based on a new compiler in the web browser. The text and picture below replaces the text and picture on page 10 of the Guide:
|
||||
|
||||
### How does my program get onto the BBC micro:bit?
|
||||
### How does my program get onto the @boardname@?
|
||||
|
||||
For your program to work on the BBC micro:bit, 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 BBC micro:bit. 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 micro:bit runtime.
|
||||
|
||||

|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
# The BBC micro:bit - a reactive system
|
||||
# The @boardname@ - a reactive system
|
||||
|
||||
The BBC micro:bit is a reactive system. #docs
|
||||
The @boardname@ is a reactive system. #docs
|
||||
|
||||
### Computing systems
|
||||
|
||||
What sort of a *computing system* is the BBC micro:bit?
|
||||
What sort of a *computing system* is the @boardname@?
|
||||
|
||||
### ~hint
|
||||
|
||||
@ -12,21 +12,21 @@ There are different types of computing systems, to address different kinds of pr
|
||||
|
||||
### ~
|
||||
|
||||
The BBC micro:bit is a *reactive system* – it reacts continuously to external events, such as a person pressing the A button of the BBC micro:bit or shaking the device. The reaction to an event may be to perform a computation, update variables, and change the display. After the device reacts to an event, it is ready to react to the next one. If this sounds like a computer game, that’s because most computer games are reactive systems too!
|
||||
The @boardname@ is a *reactive system* – it reacts continuously to external events, such as a person pressing the A button of the @boardname@ or shaking the device. The reaction to an event may be to perform a computation, update variables, and change the display. After the device reacts to an event, it is ready to react to the next one. If this sounds like a computer game, that’s because most computer games are reactive systems too!
|
||||
|
||||
### Responsiveness
|
||||
|
||||
We want reactive systems to be responsive, which means to react in a timely manner to events. For example, when you play a computer game, it’s frustrating if you press a button to make a character jump, but it doesn’t immediately jump. A delay in reacting, or lack of responsiveness , can be the difference between life and death, both in the real and virtual worlds.
|
||||
|
||||
Let’s consider a simple example: you want to program your BBC micro:bit to accurately count the number of times the A button has been pressed and continuously display the current count on the 5x5 [LED screen](/device/screen). Because the LED screen is small, we can only display one digit of a number at a time on it. The [show number](/reference/basic/show-number) function will scroll the digits of a number across the screen so you can read it.
|
||||
Let’s consider a simple example: you want to program your @boardname@ to accurately count the number of times the A button has been pressed and continuously display the current count on the 5x5 [LED screen](/device/screen). Because the LED screen is small, we can only display one digit of a number at a time on it. The [show number](/reference/basic/show-number) function will scroll the digits of a number across the screen so you can read it.
|
||||
|
||||
Let’s say that the current count is 42 and the number 42 is scrolling across the LED screen. This means there is some code executing to perform the scroll. So, what should happen if you press the A button during the scroll? It would be a bad idea to ignore the button press, so some code should record the occurrence of the button press. But we just said there already is code running in order to scroll the number 42! If we wait until the code scrolling the 42 has finished to look for a button press, we will miss the button press. We want to avoid this sort of unresponsiveness.
|
||||
|
||||
### Concurrency
|
||||
|
||||
To be responsive, a reactive system needs to be able to do several things at the same time (concurrently), just like you can. But the BBC micro:bit only has one CPU for executing your program, which means it can only execute one program instruction at a time. On the other hand, it can execute millions of instructions in a single second. This points the way to a solution.
|
||||
To be responsive, a reactive system needs to be able to do several things at the same time (concurrently), just like you can. But the @boardname@ only has one CPU for executing your program, which means it can only execute one program instruction at a time. On the other hand, it can execute millions of instructions in a single second. This points the way to a solution.
|
||||
|
||||
Think about how a motion picture projector works - it projects only 24 frames per second, yet this is good enough to provide the illusion of fluid motion on the screen. The BBC micro:bit can execute millions of instructions per second, so it seems quite possible for the device to both to smoothly scroll the number 42 across the LED screen while looking for button presses and counting them.
|
||||
Think about how a motion picture projector works - it projects only 24 frames per second, yet this is good enough to provide the illusion of fluid motion on the screen. The @boardname@ can execute millions of instructions per second, so it seems quite possible for the device to both to smoothly scroll the number 42 across the LED screen while looking for button presses and counting them.
|
||||
|
||||
Let’s think about three sequences of instructions:
|
||||
|
||||
@ -44,9 +44,9 @@ The result is that it takes sequence S1 a little longer to complete, due to the
|
||||
|
||||
As we’ll soon see, there are other choices for how the sequences can be ordered to achieve the desired result.
|
||||
|
||||
### The BBC micro:bit scheduler and queuing up subprograms
|
||||
### The @boardname@ scheduler and queuing up subprograms
|
||||
|
||||
The BBC micro:bit’s *scheduler* provides the capability to concurrently execute different code sequences, relieving us of a lot of low-level programming. In fact, scheduling is so useful that it is a part of every *operating system*!
|
||||
The @boardname@’s *scheduler* provides the capability to concurrently execute different code sequences, relieving us of a lot of low-level programming. In fact, scheduling is so useful that it is a part of every *operating system*!
|
||||
|
||||
The first job of the scheduler is to allow multiple *subprograms* to be queued up for later execution . For our purposes, a subprogram is just a statement or sequence of statements in the context of a larger program. Consider the Touch Develop program below for counting button presses.
|
||||
|
||||
@ -98,7 +98,7 @@ The answer is “cooperation” and “passing”. Think of a football team doi
|
||||
|
||||
If you hadn’t guessed already, a footballer represents subprogram and dribbling the ball corresponds to that subprogram executing. Only one subprogram gets to execute at a time, as there is only one ball (processor). Footballer Alice passing the ball to footballer Bob corresponds to stopping execution of Alice’s subprogram (and remembering where it stopped) and starting/resuming execution of Bob’s subprogram.
|
||||
|
||||
We will call this “passing control of execution” rather than “passing the ball”. However, in the world of the BBC micro:bit, the concurrently executing subprograms are not aware of each other, so they don’t actually pass control directly to one another. Rather they pass control of execution back to the scheduler and the scheduler determines the subprogram to pass control to next. The programmer inserts a call to the `pause` function to indicate a point in the subprogram where control of execution passes to the scheduler. Also, when a subprogram ends execution, control passes to the scheduler.
|
||||
We will call this “passing control of execution” rather than “passing the ball”. However, in the world of the @boardname@, the concurrently executing subprograms are not aware of each other, so they don’t actually pass control directly to one another. Rather they pass control of execution back to the scheduler and the scheduler determines the subprogram to pass control to next. The programmer inserts a call to the `pause` function to indicate a point in the subprogram where control of execution passes to the scheduler. Also, when a subprogram ends execution, control passes to the scheduler.
|
||||
|
||||
Let’s take a look at the implementation of the `forever` statement to see an example of cooperative scheduling:
|
||||
|
||||
@ -118,7 +118,7 @@ The property of such round-robin scheduling is that under the assumption that ev
|
||||
|
||||
### Putting it all together
|
||||
|
||||
Let’s go back to the `count button presses` function and revisit its execution based on what we have learned about the BBC micro:bit scheduler. As detailed before, the function executes three steps to: (1) initialize the variable `count` to zero; (2) set up the event handler for each press of button A; (3) queue the forever loop to the run queue.
|
||||
Let’s go back to the `count button presses` function and revisit its execution based on what we have learned about the @boardname@ scheduler. As detailed before, the function executes three steps to: (1) initialize the variable `count` to zero; (2) set up the event handler for each press of button A; (3) queue the forever loop to the run queue.
|
||||
|
||||
The function then ends execution and control passes back to the scheduler. Let’s assume the user has not pressed any buttons . The scheduler finds the `forever` loop in the run queue and passes control to it. The loop first calls `basic -> show number(0,150)`. In the diagram below, we use “Show 0” to refer to the execution of this function:
|
||||
|
||||
@ -128,7 +128,7 @@ While "Show 0" (the blue sequence) is running, periodic interrupts by the schedu
|
||||
|
||||
### Final thoughts
|
||||
|
||||
Through this example, we have seen that the BBC micro:bit 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.
|
||||
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:
|
||||
|
||||
|
@ -2,9 +2,9 @@
|
||||
|
||||
The serial library #docs
|
||||
|
||||
The **serial library** supports [serial communication](https://en.wikipedia.org/wiki/Serial_port) between the BBC micro:bit 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 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 code below shows a simple script that sends a line when the BBC micro:bit starts and another line each time the button ``A`` is pressed.
|
||||
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.
|
||||
|
||||
```
|
||||
serial.writeLine("started...")
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
## Get Started with These Hex Files!
|
||||
|
||||
If you have a BBC micro:bit and would like to explore a few scripts, we've created the following hex files for you to copy to your BBC micro:bit
|
||||
If you have a @boardname@ and would like to explore a few scripts, we've created the following hex files for you to copy to your @boardname@
|
||||
|
||||
### Flashing Heart
|
||||
|
||||
|
@ -6,21 +6,21 @@ While you're writing and testing your scripts, you'll mostly be running scripts
|
||||
|
||||
*Note*: in the Touch Develop editor, the button actually is named `run main`, reflecting the fact that execution of a Touch Develop script always beings in the `main` function
|
||||
|
||||
When you click `run main` in the Touch Develop editor, your code executes and the results are simulated on-screen, using an image of the BBC micro:bit device, like this:
|
||||
When you click `run main` in the Touch Develop editor, your code executes and the results are simulated on-screen, using an image of the @boardname@ device, like this:
|
||||
|
||||
|
||||
In the picture above, [plot image](/reference/led/plot-image) create a heart image that appears on the BBC micro:bit simulator.
|
||||
In the picture above, [plot image](/reference/led/plot-image) create a heart image that appears on the @boardname@ simulator.
|
||||
|
||||
The BBC micro:bit simulator let's you...
|
||||
The @boardname@ simulator let's you...
|
||||
|
||||
* write and test code, even if you don't have a BBC micro:bit device
|
||||
* test your code throughly before downloading and running your script on the BBC micro:bit
|
||||
* write and test code, even if you don't have a @boardname@ device
|
||||
* test your code throughly before downloading and running your script on the @boardname@
|
||||
|
||||
### What does the simulator support?
|
||||
|
||||
The BBC micro:bit simulator supports the Touch Develop [functions](/js/contents) and Microsoft [blocks](/blocks/contents), including those related to the LED screen, input buttons, the compass, accelerometer, and the digital I/O pins.
|
||||
The @boardname@ simulator supports the Touch Develop [functions](/js/contents) and Microsoft [blocks](/blocks/contents), including those related to the LED screen, input buttons, the compass, accelerometer, and the digital I/O pins.
|
||||
|
||||
* **LED screen**: the [LED screen](/device/screen) that appears on-screen shows you what you'll see on the BBC micro:bit device
|
||||
* **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.
|
||||
@ -32,11 +32,11 @@ 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 BBC micro:bit 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 micro:bit](/device/usb).
|
||||
|
||||
### Simulator vs micro:bit
|
||||
|
||||
Running your scripts in a web browser is a *simulation* of how your code will run on the BBC micro:bit device. When you run your script on your BBC micro:bit device, the results may differ slightly. For example, the timing may be subtly different when your script runs on the BBC micro:bit device (you may need to adjust your [pause](/reference/basic/pause) functions). For this reason, be sure to test your scripts on the BBC micro:bit device.
|
||||
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
|
||||
|
||||
|
@ -4,7 +4,7 @@ string-related functions.
|
||||
|
||||
### @parent js/language
|
||||
|
||||
The following string related functions are available in Touch Develop for the BBC micro:bit:
|
||||
The following string related functions are available in Touch Develop for the @boardname@:
|
||||
|
||||
* **equals** - find out if two strings are the same
|
||||
* **at** - get a character within a string
|
||||
|
@ -4,7 +4,7 @@ a piece of text.
|
||||
|
||||
### @parent js/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).
|
||||
|
||||
### Declare a string
|
||||
|
||||
|
@ -5,7 +5,7 @@ Touch Develop types.
|
||||
### @parent language
|
||||
|
||||
|
||||
A *type* refers to a class of data and the operations permitted on that data. The following types are supported by Touch Develop for the BBC micro:bit:
|
||||
A *type* refers to a class of data and the operations permitted on that data. The following types are supported by Touch Develop for the @boardname@:
|
||||
|
||||
* **[String](/reference/types/string)**: a sequence of characters
|
||||
* **[Number](/reference/types/number)**: an integer number (32-bit signed)
|
||||
|
Reference in New Issue
Block a user