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

@ -35,7 +35,7 @@ basic.forever(() => {
The following example keeps showing the [number](/reference/types/number) stored in a global variable.
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
let num = 0

View File

@ -21,7 +21,7 @@ basic.showAnimation(`
In this animation, each row is 15 spaces wide because
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
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.
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:
@ -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.
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

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
2. Select Bluetooth
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.
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.
@ -47,7 +47,7 @@ https://www.youtube.com/watch?v=AoW3mit7jIg
1. Go into Settings
2. Select Bluetooth
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.
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.

View File

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

View File

@ -1,6 +1,6 @@
# Devices
Control a phone with the BBC micro:bit via Bluetooth.
Control a phone with the @boardname@ via Bluetooth.
```cards
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
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).
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
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).
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
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).
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
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).
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
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).
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
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).
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
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).
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 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

View File

@ -2,7 +2,7 @@
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

View File

@ -2,7 +2,7 @@
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

View File

@ -2,7 +2,7 @@
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

View File

@ -2,7 +2,7 @@
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 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).
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).
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
on the BBC micro:bit.
on the @boardname@.
```sig
input.onButtonPressed(Button.A, () => {})

View File

@ -19,7 +19,7 @@ input.onPinPressed(TouchPin.P0, () => {
## ~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.
## ~
@ -44,5 +44,5 @@ input.onPinPressed(TouchPin.P0, () => {
### 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
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.
## ~
@ -44,5 +44,5 @@ input.onPinReleased(TouchPin.P0, () => {
### 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
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.
## ~
@ -41,5 +41,5 @@ basic.forever(() => {
### 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
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.
## ~
@ -23,7 +23,7 @@ check how the micro:bit is moving.
### 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.
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?
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
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!

View File

@ -11,7 +11,7 @@ led.plotBarGraph(2, 20);
* ``value`` is a [number](/reference/types/number) that means what you
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.
* ``high`` is a [number](/reference/types/number) that means the highest
possible number that the ``value`` parameter can be. This number is

View File

@ -1,6 +1,6 @@
# 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
basic.showLeds(`

View File

@ -2,7 +2,7 @@
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:

View File

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

View File

@ -44,5 +44,5 @@ pins.servoWritePin(AnalogPin.P0, 0)
### 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
[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
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
* **[Number](/reference/types/number)**: an integer number (32-bit signed)

View File

@ -4,7 +4,7 @@ a piece of text.
### @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