rename micro:bit to @boardname@
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# Basic
|
||||
|
||||
Provides access to basic micro:bit functionality.
|
||||
Provides access to basic @boardname@ functionality.
|
||||
|
||||
```cards
|
||||
basic.showNumber(0);
|
||||
|
||||
@@ -52,7 +52,7 @@ input.onButtonPressed(Button.A, () => {
|
||||
If different parts of a program are each trying
|
||||
to show something on the LED screen at the same time,
|
||||
you may get unexpected results.
|
||||
Try this on your micro:bit:
|
||||
Try this on your @boardname@:
|
||||
|
||||
```blocks
|
||||
basic.forever(() => {
|
||||
|
||||
@@ -5,7 +5,7 @@ Support for additional Bluetooth services.
|
||||
### ~hint
|
||||

|
||||
|
||||
For another device like a smartphone to use any of the Bluetooth "services" which the micro:bit has, it must first be [paired with the micro:bit](/reference/bluetooth/bluetooth-pairing). Once paired, the other device may connect to the micro:bit and exchange data relating to many of the micro:bit's features.
|
||||
For another device like a smartphone to use any of the Bluetooth "services" which the @boardname@ has, it must first be [paired with the @boardname@](/reference/bluetooth/bluetooth-pairing). Once paired, the other device may connect to the @boardname@ and exchange data relating to many of the @boardname@'s features.
|
||||
|
||||
### ~
|
||||
|
||||
@@ -37,7 +37,7 @@ bluetooth
|
||||
|
||||
### Advanced
|
||||
|
||||
For more advanced information on the micro:bit Bluetooth UART service including information on using a smartphone, see the [Lancaster University micro:bit runtime technical documentation](http://lancaster-university.github.io/microbit-docs/ble/uart-service/)
|
||||
For more advanced information on the @boardname@ Bluetooth UART service including information on using a smartphone, see the [Lancaster University @boardname@ runtime technical documentation](http://lancaster-university.github.io/microbit-docs/ble/uart-service/)
|
||||
|
||||
### See Also
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
Bluetooth is a wireless communications technology which allows devices to communicate with each other without the need for a central device like a router or access point.
|
||||
|
||||
Bluetooth has a special "low energy feature" which means it can be used without requiring much power from the devices using it. It's the Bluetooth low energy feature which the micro:bit uses.
|
||||
Bluetooth has a special "low energy feature" which means it can be used without requiring much power from the devices using it. It's the Bluetooth low energy feature which the @boardname@ uses.
|
||||
|
||||
In the world of Bluetooth low energy, a device has something called a "profile" which defines the way other devices are able to communicate over Bluetooth with it. In a way, the Bluetooth profile defines the way a device appears to other devices in terms of its features and the things it can do.
|
||||
|
||||
@@ -20,7 +20,7 @@ The Attribute Table contains something like a series of records of various types
|
||||
|
||||
### Attributes
|
||||
|
||||
Services, Characteristics and Descriptors are all types of Attribute. Hence Generic Attribute Profile, Attribute Table and something called the Attribute Protocol. All attributes have a type which is identified by a UUID (Universally Unique Identifer). Some Attributes are defined by the Bluetooth SIG, the technical standards body for Bluetooth and these have UUIDs which are 16 bits in length. Some Attributes are custom designed for a particular device by the product team and these have 128 bit UUIDs. The micro:bit uses a mixture of 16 bit and 128 bit UUIDs.
|
||||
Services, Characteristics and Descriptors are all types of Attribute. Hence Generic Attribute Profile, Attribute Table and something called the Attribute Protocol. All attributes have a type which is identified by a UUID (Universally Unique Identifer). Some Attributes are defined by the Bluetooth SIG, the technical standards body for Bluetooth and these have UUIDs which are 16 bits in length. Some Attributes are custom designed for a particular device by the product team and these have 128 bit UUIDs. The @boardname@ uses a mixture of 16 bit and 128 bit UUIDs.
|
||||
|
||||
### Structure
|
||||
|
||||
@@ -30,7 +30,7 @@ Services, Characteristics and Descriptors are organised in a hierarchy with Serv
|
||||
|
||||
### Services
|
||||
|
||||
A Service is a container for logically related Bluetooth data items. Those data items are in fact called Characteristics. A Service can be thought of as the owner of the Characteristics inside it. Often a Service represents a particular feature (e.g. a hardware feature) of a device like the buttons or a particular sensor. An example of a Bluetooth SIG defined Service is the Device Information Service which, as the name suggests, is a container for various items of information about the device such as its manufacturer and serial number. The micro:bit has this service.
|
||||
A Service is a container for logically related Bluetooth data items. Those data items are in fact called Characteristics. A Service can be thought of as the owner of the Characteristics inside it. Often a Service represents a particular feature (e.g. a hardware feature) of a device like the buttons or a particular sensor. An example of a Bluetooth SIG defined Service is the Device Information Service which, as the name suggests, is a container for various items of information about the device such as its manufacturer and serial number. The @boardname@ has this service.
|
||||
|
||||
### Characteristics
|
||||
|
||||
@@ -40,7 +40,7 @@ Characteristics contain various parts. They have a type, a value, some propertie
|
||||
|
||||
Type is something already explained above, a UUID value which indicates which particular type of Characteristic an Attribute is. Value is the value of the associated state data item.
|
||||
|
||||
Properties define what another device can do with the characteristic over Bluetooth in terms of various defined operations such as READ, WRITE or NOTIFY. Reading a characteristic means transferring its current value from the attribute table to the connected device over Bluetooth. Writing allows the connected device to change that value in the state table. Notifications are a special message type which a device like the micro:bit can send to a connected device whenever the value of the associated characteristic changes or perhaps periodically, controlled by a timer. Not all Characteristics support all operations. The Characteristic's properties tell you which operations are supported.
|
||||
Properties define what another device can do with the characteristic over Bluetooth in terms of various defined operations such as READ, WRITE or NOTIFY. Reading a characteristic means transferring its current value from the attribute table to the connected device over Bluetooth. Writing allows the connected device to change that value in the state table. Notifications are a special message type which a device like the @boardname@ can send to a connected device whenever the value of the associated characteristic changes or perhaps periodically, controlled by a timer. Not all Characteristics support all operations. The Characteristic's properties tell you which operations are supported.
|
||||
|
||||
Sometimes the device will have been programmed to respond in a special way when it processes an operation like reading or writing a value from the attribute table so operations can result in more happening than simply transferring data across the connection. Perhaps changing the value of a Characteristic will result in the device changing the frequency with which it samples readings from the device accelerometer for example.
|
||||
|
||||
@@ -56,7 +56,7 @@ A Bluetooth profile is a specification which pulls together all the required inf
|
||||
|
||||
## Client Server Architecture
|
||||
|
||||
When a smartphone application interacts with a device like the micro:bit over a Bluetooth connection we have a client/server architecture. The phone application is usually the GATT client and the micro:bit is usually the GATT server. They communicate using a protocol called the Attribute Protocol or just ATT for short. As a smartphone developer you work with APIs and do not have to worry about formulating ATT protocol data units and so on.
|
||||
When a smartphone application interacts with a device like the @boardname@ over a Bluetooth connection we have a client/server architecture. The phone application is usually the GATT client and the @boardname@ is usually the GATT server. They communicate using a protocol called the Attribute Protocol or just ATT for short. As a smartphone developer you work with APIs and do not have to worry about formulating ATT protocol data units and so on.
|
||||
|
||||

|
||||
|
||||
@@ -64,19 +64,19 @@ When a smartphone application interacts with a device like the micro:bit over a
|
||||
|
||||
Everything described above relates to devices which are connected and communicating as GATT client and server. But there's a stage which precedes this where the two devices are not yet connected. How do they find each other and connect? The answer to this question is termed 'Device Discovery' and is the responsibility of another part of the Bluetooth architecture called the Generic Access Profile (GAP).
|
||||
|
||||
In GAP, one devices advertises, emitting small packets of data periodically. These packets contain information about the device doing the advertising. Other devices looking for devices to connect to perform something called scanning, receiving and processing advertising packets and filtering out those that come from devices of a type that are not of interest. Usually the user is given information about devices which are discovered and they then select one to be connected to. The device which advertises is called a Bluetooth Peripheral whereas the one doing the scanning is a Bluetooth Central device. micro:bit is a Bluetooth peripheral.
|
||||
In GAP, one devices advertises, emitting small packets of data periodically. These packets contain information about the device doing the advertising. Other devices looking for devices to connect to perform something called scanning, receiving and processing advertising packets and filtering out those that come from devices of a type that are not of interest. Usually the user is given information about devices which are discovered and they then select one to be connected to. The device which advertises is called a Bluetooth Peripheral whereas the one doing the scanning is a Bluetooth Central device. @boardname@ is a Bluetooth peripheral.
|
||||
|
||||
Bluetooth on the @boardname@
|
||||
|
||||
Full documentation for the @boardname@ Bluetooth profile as used by this application can be found at the [Lancaster University documentation](http://lancaster-university.github.io/microbit-docs/ble/profile/) web site.
|
||||
|
||||
The micro:bit's accelerometer (motion detector), magnetometer (digital compass), two buttons on the front, LED Display, IO pins on the edge connector, internal message bus and internal temperature sensor are all exposed as Services so that applications can exploit these features of the device. In addition:
|
||||
The @boardname@'s accelerometer (motion detector), magnetometer (digital compass), two buttons on the front, LED Display, IO pins on the edge connector, internal message bus and internal temperature sensor are all exposed as Services so that applications can exploit these features of the device. In addition:
|
||||
|
||||
* the Bluetooth SIG defined Device Information Service is included to allow applications to obtain information such as firmware version details over Bluetooth
|
||||
* there's a Device Firmware Update (DFU) service which allows new micro:bit code to be flahsed to the device over Bluetooth instead of over USB
|
||||
* there's a UART service which allows arbitrary data to be exchanged with the micro:bit in a way resembling traditional serial communications.
|
||||
* there's a Device Firmware Update (DFU) service which allows new @boardname@ code to be flahsed to the device over Bluetooth instead of over USB
|
||||
* there's a UART service which allows arbitrary data to be exchanged with the @boardname@ in a way resembling traditional serial communications.
|
||||
|
||||
Everything you can do with the micro:bit over Bluetooth is achieved through read, write and notify operations. Not all characteristics support all three so check the profile documentation. Often there are Characteristics whose purpose is to allow you to write configuration values which control other behviours. Technically these are called Control Points. For example you can specify the frequency with which accelerometer data is sampled before it is transmitted as a Notification message to your application.
|
||||
Everything you can do with the @boardname@ over Bluetooth is achieved through read, write and notify operations. Not all characteristics support all three so check the profile documentation. Often there are Characteristics whose purpose is to allow you to write configuration values which control other behviours. Technically these are called Control Points. For example you can specify the frequency with which accelerometer data is sampled before it is transmitted as a Notification message to your application.
|
||||
|
||||
## Want to Know More?
|
||||
|
||||
@@ -92,7 +92,7 @@ https://www.youtube.com/watch?v=aep_GVowKfs
|
||||
|
||||
### See also
|
||||
|
||||
[About Bluetooth](/reference/bluetooth/about-bluetooth), [micro:bit Bluetooth profile overview ](http://lancaster-university.github.io/microbit-docs/ble/profile/), [micro:bit Bluetooth profile reference](http://lancaster-university.github.io/microbit-docs/resources/bluetooth/microbit-profile-V1.9-Level-2.pdf), [Bluetooth on micro:bit resources](http://bluetooth-mdw.blogspot.co.uk/p/bbc-microbit.html), [Bluetooth SIG](https://www.bluetooth.com)
|
||||
[About Bluetooth](/reference/bluetooth/about-bluetooth), [@boardname@ Bluetooth profile overview ](http://lancaster-university.github.io/microbit-docs/ble/profile/), [@boardname@ Bluetooth profile reference](http://lancaster-university.github.io/microbit-docs/resources/bluetooth/microbit-profile-V1.9-Level-2.pdf), [Bluetooth on @boardname@ resources](http://bluetooth-mdw.blogspot.co.uk/p/bbc-microbit.html), [Bluetooth SIG](https://www.bluetooth.com)
|
||||
|
||||
```package
|
||||
bluetooth
|
||||
|
||||
@@ -3,96 +3,96 @@
|
||||
### ~hint
|
||||

|
||||
|
||||
For another device like a smartphone to use any of the Bluetooth "services" which the micro:bit has, it must first be [paired with the micro:bit](/reference/bluetooth/bluetooth-pairing). Once paired, the other device may connect to the micro:bit and exchange data relating to many of the micro:bit's features.
|
||||
For another device like a smartphone to use any of the Bluetooth "services" which the @boardname@ has, it must first be [paired with the @boardname@](/reference/bluetooth/bluetooth-pairing). Once paired, the other device may connect to the @boardname@ and exchange data relating to many of the @boardname@'s features.
|
||||
|
||||
### ~
|
||||
|
||||
### What is 'pairing'?
|
||||
|
||||
'Pairing' is what you have to do to have your micro:bit trust another device like a smartphone and similarly, have your smartphone trust your micro:bit. Why 'trust'? Well, pairing is all about security. You wouldn't usually want just anyone's smartphone connecting to your micro:bit and making it do things so by pairing *your* smartphone with *your* micro:bit you ensure that only your devices can talk to each other.
|
||||
'Pairing' is what you have to do to have your @boardname@ trust another device like a smartphone and similarly, have your smartphone trust your @boardname@. Why 'trust'? Well, pairing is all about security. You wouldn't usually want just anyone's smartphone connecting to your @boardname@ and making it do things so by pairing *your* smartphone with *your* @boardname@ you ensure that only your devices can talk to each other.
|
||||
|
||||
Once you've paired your micro:bit with another device it also means that they are able to exchange information privately, without someone else being able to "see" the data they're exchanging over the air using Bluetooth. This is accomplished by data being [encrypted](https://en.wikipedia.org/wiki/Encryption) and pairing makes it possible for devices who trust each other to encrypt and decrypt data from each other.
|
||||
Once you've paired your @boardname@ with another device it also means that they are able to exchange information privately, without someone else being able to "see" the data they're exchanging over the air using Bluetooth. This is accomplished by data being [encrypted](https://en.wikipedia.org/wiki/Encryption) and pairing makes it possible for devices who trust each other to encrypt and decrypt data from each other.
|
||||
|
||||
# How do you pair your micro:bit with another device?
|
||||
# How do you pair your @boardname@ with another device?
|
||||
|
||||
Making your micro:bit pair requires you to follow some simple steps which will be described shortly. What you do with the device you're pairing it to will vary slightly depending on what that device is. We'll look at how it's done with common smartphones and tablets here too.
|
||||
Making your @boardname@ pair requires you to follow some simple steps which will be described shortly. What you do with the device you're pairing it to will vary slightly depending on what that device is. We'll look at how it's done with common smartphones and tablets here too.
|
||||
|
||||
To get your micro:bit ready for pairing do the following:
|
||||
To get your @boardname@ ready for pairing do the following:
|
||||
|
||||
1. Hold down buttons A and B on the front of your micro:bit together. The front is the side with two buttons and the LED display. Keep the two buttons held down. Don't let go of them yet!
|
||||
2. While still holding down buttons A and B, press and then release the reset button on the back of the micro:bit. Keep holding down buttons A and B.
|
||||
3. You should see "PAIRING MODE!" start to scroll across the micro:bit display. When you see this message start to appear you can release buttons A and B.
|
||||
4. Eventually you'll see a strange pattern on your micro:bit display. This is like your micro:bit's signature. Other people's micro:bits will probably display a different pattern.
|
||||
1. Hold down buttons A and B on the front of your @boardname@ together. The front is the side with two buttons and the LED display. Keep the two buttons held down. Don't let go of them yet!
|
||||
2. While still holding down buttons A and B, press and then release the reset button on the back of the @boardname@. Keep holding down buttons A and B.
|
||||
3. You should see "PAIRING MODE!" start to scroll across the @boardname@ display. When you see this message start to appear you can release buttons A and B.
|
||||
4. Eventually you'll see a strange pattern on your @boardname@ display. This is like your @boardname@'s signature. Other people's @boardname@s will probably display a different pattern.
|
||||
|
||||
Your micro:bit is now ready to be paired with the other device. Read the section below which relates to your 'other' device and watch the video too.
|
||||
Your @boardname@ is now ready to be paired with the other device. Read the section below which relates to your 'other' device and watch the video too.
|
||||
|
||||
### How do you pair your micro:bit with a Windows smartphone or tablet?
|
||||
### How do you pair your @boardname@ with a Windows smartphone or tablet?
|
||||
|
||||
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 '@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.
|
||||
8. Enter the 6 digits which the micro:bit displayed into your Windows smartphone in the pop-up box provided and then select "done".
|
||||
9. If you entered the right number the micro:bit will display a tick / check mark. If you made a mistake it will display a cross or X and you should repeat the process to try again.
|
||||
3. Switch your @boardname@ into 'pairing mode' using the steps above
|
||||
4. Wait until 'PAIRING MODE!' has finished scrolling across the @boardname@ display. You should see your @boardname@ 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 @boardname@ named in the device list. This will initiate the pairing process.
|
||||
6. The @boardname@ 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 @boardname@ and watch carefully as the @boardname@ displays a sequence of 6 random numbers. You may find it easier to write them down than to remember them.
|
||||
8. Enter the 6 digits which the @boardname@ displayed into your Windows smartphone in the pop-up box provided and then select "done".
|
||||
9. If you entered the right number the @boardname@ will display a tick / check mark. If you made a mistake it will display a cross or X and you should repeat the process to try again.
|
||||
|
||||
#### Video
|
||||
https://www.youtube.com/watch?v=AoW3mit7jIg
|
||||
|
||||
|
||||
### How do you pair your micro:bit with an Android smartphone or tablet?
|
||||
### How do you pair your @boardname@ with an Android smartphone or tablet?
|
||||
|
||||
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 '@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.
|
||||
8. Enter the 6 digits which the micro:bit displayed into your Android smartphone in the pop-up box provided and then select "done".
|
||||
9. If you entered the right number the micro:bit will display a tick / check mark. If you made a mistake it will display a cross or X and you should repeat the process to try again.
|
||||
3. Switch your @boardname@ into 'pairing mode' using the steps above
|
||||
4. Wait until 'PAIRING MODE!' has finished scrolling across the @boardname@ display. You should see your @boardname@ 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 @boardname@ named in the Available devices list. This will initiate the pairing process.
|
||||
6. The @boardname@ 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 @boardname@ and watch carefully as the @boardname@ displays a sequence of 6 random numbers. You may find it easier to write them down than to remember them.
|
||||
8. Enter the 6 digits which the @boardname@ displayed into your Android smartphone in the pop-up box provided and then select "done".
|
||||
9. If you entered the right number the @boardname@ will display a tick / check mark. If you made a mistake it will display a cross or X and you should repeat the process to try again.
|
||||
|
||||
#### Video
|
||||
https://www.youtube.com/watch?v=7hLBfdAGkZI
|
||||
|
||||
### How do you pair your micro:bit with an Apple iOS smartphone or tablet?
|
||||
### How do you pair your @boardname@ with an Apple iOS smartphone or tablet?
|
||||
|
||||
The steps to pair with an Apple iOS device are different to those followed for an Android or Windows device. To trigger pairing you need an application which will try to interact with your micro:bit and it's that interaction that triggers the iOS pairing process. There are many you could use but for the purposes of this documentation we'll suggest you install the "nRF Master Control Panel" (nRF MCP) application from Nordic Semiconductor. You'll find it in the Apple app store. It's a really useful Bluetooth application which will help you learn about Bluetooth as well as it having the ability to trigger the pairing process. After installing nRF MCP you should follow these steps to pair with your micro:bit:
|
||||
The steps to pair with an Apple iOS device are different to those followed for an Android or Windows device. To trigger pairing you need an application which will try to interact with your @boardname@ and it's that interaction that triggers the iOS pairing process. There are many you could use but for the purposes of this documentation we'll suggest you install the "nRF Master Control Panel" (nRF MCP) application from Nordic Semiconductor. You'll find it in the Apple app store. It's a really useful Bluetooth application which will help you learn about Bluetooth as well as it having the ability to trigger the pairing process. After installing nRF MCP you should follow these steps to pair with your @boardname@:
|
||||
|
||||
1. Switch your micro:bit into 'pairing mode' using the steps above
|
||||
2. Wait until 'PAIRING MODE!' has finished scrolling across the micro:bit display.
|
||||
3. Launch the nRF MCP application. Your micro:bit should be listed and have a "Connect" button next to it.
|
||||
4. Select "Connect" to connect your Apple device to the micro:bit. This will trigger the pairing process.
|
||||
5. The micro:bit will display a left pointing arrow and the Apple device will pop up a box into which you will be invited to enter a "pin" (Personal Identity Number).
|
||||
6. Press button A on the micro:bit and watch carefully as the micro:bit displays a sequence of 6 random numbers. You may find it easier to write them down than to remember them.
|
||||
7. Enter the 6 digits which the micro:bit displayed into your Apple device in the pop-up box provided and then select "Pair".
|
||||
8. If you entered the right number the micro:bit will display a tick / check mark. If you made a mistake it will display a cross or X and you should repeat the process to try again.
|
||||
1. Switch your @boardname@ into 'pairing mode' using the steps above
|
||||
2. Wait until 'PAIRING MODE!' has finished scrolling across the @boardname@ display.
|
||||
3. Launch the nRF MCP application. Your @boardname@ should be listed and have a "Connect" button next to it.
|
||||
4. Select "Connect" to connect your Apple device to the @boardname@. This will trigger the pairing process.
|
||||
5. The @boardname@ will display a left pointing arrow and the Apple device will pop up a box into which you will be invited to enter a "pin" (Personal Identity Number).
|
||||
6. Press button A on the @boardname@ and watch carefully as the @boardname@ displays a sequence of 6 random numbers. You may find it easier to write them down than to remember them.
|
||||
7. Enter the 6 digits which the @boardname@ displayed into your Apple device in the pop-up box provided and then select "Pair".
|
||||
8. If you entered the right number the @boardname@ will display a tick / check mark. If you made a mistake it will display a cross or X and you should repeat the process to try again.
|
||||
|
||||
#### Video
|
||||
https://www.youtube.com/watch?v=wslwyAMwMhs
|
||||
|
||||
|
||||
### How often do I need to pair my micro:bit with my phone?
|
||||
### How often do I need to pair my @boardname@ with my phone?
|
||||
|
||||
You do *not* need to pair your micro:bit and smartphone or tablet every time you use them together. Pairing establishes 'trust' which will be retained until it is somehow lost. When another device wants to talk to your micro:bit it must connect to it but connecting and pairing are not the same thing.
|
||||
You do *not* need to pair your @boardname@ and smartphone or tablet every time you use them together. Pairing establishes 'trust' which will be retained until it is somehow lost. When another device wants to talk to your @boardname@ it must connect to it but connecting and pairing are not the same thing.
|
||||
|
||||
There are circumstances which will result in pairing data being lost however and when this happens you will need to pair again.
|
||||
|
||||
Currently, flashing new code via a USB cable causes the micro:bit's Bluetooth pairing data to be lost. Consequently, if you do flash new code to your micro:bit using a USB cable you will need to pair again.
|
||||
Currently, flashing new code via a USB cable causes the @boardname@'s Bluetooth pairing data to be lost. Consequently, if you do flash new code to your @boardname@ using a USB cable you will need to pair again.
|
||||
|
||||
In contrast if you upload new code to your micro:bit over Bluetooth, using for example the Samsung micro:bit application for Android devices, you will not need to pair again.
|
||||
In contrast if you upload new code to your @boardname@ over Bluetooth, using for example the Samsung @boardname@ application for Android devices, you will not need to pair again.
|
||||
|
||||
If you do find yourself needing to pair again you will first need to remove the pairing from your other device (i.e. smartphone or tablet):
|
||||
|
||||
* On Android go into Settings/Bluetooth, select the 'cog' next to your micro:bit and then select FORGET
|
||||
* On iOS go into Settings/Bluetooth, select your micro:bit and then select Forget This Device
|
||||
* On a Windows device go into Settings/Bluetooth. Press and hold the micro:bit entry on the Windows device. A pop-up will appear with the option "delete". Select "delete" to unpair your micro:bit.
|
||||
* On Android go into Settings/Bluetooth, select the 'cog' next to your @boardname@ and then select FORGET
|
||||
* On iOS go into Settings/Bluetooth, select your @boardname@ and then select Forget This Device
|
||||
* On a Windows device go into Settings/Bluetooth. Press and hold the @boardname@ entry on the Windows device. A pop-up will appear with the option "delete". Select "delete" to unpair your @boardname@.
|
||||
|
||||
### See also
|
||||
|
||||
[About Bluetooth](/reference/bluetooth/about-bluetooth), [micro:bit Bluetooth profile overview ](http://lancaster-university.github.io/microbit-docs/ble/profile/), [micro:bit Bluetooth profile reference](http://lancaster-university.github.io/microbit-docs/resources/bluetooth/microbit-profile-V1.9-Level-2.pdf), [Bluetooth on micro:bit resources](http://bluetooth-mdw.blogspot.co.uk/p/bbc-microbit.html), [Bluetooth SIG](https://www.bluetooth.com)
|
||||
[About Bluetooth](/reference/bluetooth/about-bluetooth), [@boardname@ Bluetooth profile overview ](http://lancaster-university.github.io/microbit-docs/ble/profile/), [@boardname@ Bluetooth profile reference](http://lancaster-university.github.io/microbit-docs/resources/bluetooth/microbit-profile-V1.9-Level-2.pdf), [Bluetooth on @boardname@ resources](http://bluetooth-mdw.blogspot.co.uk/p/bbc-microbit.html), [Bluetooth SIG](https://www.bluetooth.com)
|
||||
|
||||
|
||||
```package
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
### ~hint
|
||||

|
||||
|
||||
For another device like a smartphone to use any of the Bluetooth "services" which the micro:bit has, it must first be [paired with the micro:bit](/reference/bluetooth/bluetooth-pairing). Once paired, the other device may connect to the micro:bit and exchange data relating to many of the micro:bit's features.
|
||||
For another device like a smartphone to use any of the Bluetooth "services" which the @boardname@ has, it must first be [paired with the @boardname@](/reference/bluetooth/bluetooth-pairing). Once paired, the other device may connect to the @boardname@ and exchange data relating to many of the @boardname@'s features.
|
||||
|
||||
### ~
|
||||
|
||||
This block starts an [event handler](/reference/event-handler) which in this case will run
|
||||
when something connects to your micro:bit using Bluetooth.
|
||||
when something connects to your @boardname@ using Bluetooth.
|
||||
|
||||
```sig
|
||||
bluetooth.onBluetoothConnected(() => {});
|
||||
@@ -16,7 +16,7 @@ bluetooth.onBluetoothConnected(() => {});
|
||||
|
||||
### Example
|
||||
|
||||
You could use this event handler to display a letter "C" on the micro:bit LED grid so you know you have a Bluetooth connection. Or you might want to send some data you've been accumulating to your smartphone as soon as it connects to your micro:bit. Maybe you've been using the accelerometer in your micro:bit to count your steps for example. Using this event handler you could send the accumulated step count to your phone when it establishes a Bluetooth connection.
|
||||
You could use this event handler to display a letter "C" on the @boardname@ LED grid so you know you have a Bluetooth connection. Or you might want to send some data you've been accumulating to your smartphone as soon as it connects to your @boardname@. Maybe you've been using the accelerometer in your @boardname@ to count your steps for example. Using this event handler you could send the accumulated step count to your phone when it establishes a Bluetooth connection.
|
||||
|
||||
```blocks
|
||||
bluetooth.onBluetoothConnected(() => {
|
||||
@@ -30,7 +30,7 @@ http://www.youtube.com/watch?v=HyBcsD9Eh6I
|
||||
|
||||
### See also
|
||||
|
||||
[About Bluetooth](/reference/bluetooth/about-bluetooth), [micro:bit Bluetooth profile overview ](http://lancaster-university.github.io/microbit-docs/ble/profile/), [micro:bit Bluetooth profile reference](http://lancaster-university.github.io/microbit-docs/resources/bluetooth/microbit-profile-V1.9-Level-2.pdf), [Bluetooth on micro:bit resources](http://bluetooth-mdw.blogspot.co.uk/p/bbc-microbit.html), [Bluetooth SIG](https://www.bluetooth.com)
|
||||
[About Bluetooth](/reference/bluetooth/about-bluetooth), [@boardname@ Bluetooth profile overview ](http://lancaster-university.github.io/microbit-docs/ble/profile/), [@boardname@ Bluetooth profile reference](http://lancaster-university.github.io/microbit-docs/resources/bluetooth/microbit-profile-V1.9-Level-2.pdf), [Bluetooth on @boardname@ resources](http://bluetooth-mdw.blogspot.co.uk/p/bbc-microbit.html), [Bluetooth SIG](https://www.bluetooth.com)
|
||||
|
||||
```package
|
||||
bluetooth
|
||||
|
||||
@@ -3,20 +3,20 @@
|
||||
### ~hint
|
||||

|
||||
|
||||
For another device like a smartphone to use any of the Bluetooth "services" which the micro:bit has, it must first be [paired with the micro:bit](/reference/bluetooth/bluetooth-pairing). Once paired, the other device may connect to the micro:bit and exchange data relating to many of the micro:bit's features.
|
||||
For another device like a smartphone to use any of the Bluetooth "services" which the @boardname@ has, it must first be [paired with the @boardname@](/reference/bluetooth/bluetooth-pairing). Once paired, the other device may connect to the @boardname@ and exchange data relating to many of the @boardname@'s features.
|
||||
|
||||
### ~
|
||||
|
||||
This block starts an [event handler](/reference/event-handler) which in this case will run when a device which is connected to your micro:bit over Bluetooth disconnects.
|
||||
This block starts an [event handler](/reference/event-handler) which in this case will run when a device which is connected to your @boardname@ over Bluetooth disconnects.
|
||||
|
||||
You could use this event handler to display a letter "D" on the micro:bit LED grid so you know that the Bluetooth connection has been closed.
|
||||
You could use this event handler to display a letter "D" on the @boardname@ LED grid so you know that the Bluetooth connection has been closed.
|
||||
|
||||
```sig
|
||||
bluetooth.onBluetoothDisconnected(() => {
|
||||
});
|
||||
```
|
||||
|
||||
### Example: Displaying "D" when a Bluetooth connection to the micro:bit is closed
|
||||
### Example: Displaying "D" when a Bluetooth connection to the @boardname@ is closed
|
||||
|
||||
```blocks
|
||||
bluetooth.onBluetoothDisconnected(() => {
|
||||
@@ -30,7 +30,7 @@ http://www.youtube.com/watch?v=HyBcsD9Eh6I
|
||||
|
||||
### See also
|
||||
|
||||
[About Bluetooth](/reference/bluetooth/about-bluetooth), [micro:bit Bluetooth profile overview ](http://lancaster-university.github.io/microbit-docs/ble/profile/), [micro:bit Bluetooth profile reference](http://lancaster-university.github.io/microbit-docs/resources/bluetooth/microbit-profile-V1.9-Level-2.pdf), [Bluetooth on micro:bit resources](http://bluetooth-mdw.blogspot.co.uk/p/bbc-microbit.html), [Bluetooth SIG](https://www.bluetooth.com)
|
||||
[About Bluetooth](/reference/bluetooth/about-bluetooth), [@boardname@ Bluetooth profile overview ](http://lancaster-university.github.io/microbit-docs/ble/profile/), [@boardname@ Bluetooth profile reference](http://lancaster-university.github.io/microbit-docs/resources/bluetooth/microbit-profile-V1.9-Level-2.pdf), [Bluetooth on @boardname@ resources](http://bluetooth-mdw.blogspot.co.uk/p/bbc-microbit.html), [Bluetooth SIG](https://www.bluetooth.com)
|
||||
|
||||
```package
|
||||
bluetooth
|
||||
|
||||
@@ -3,15 +3,15 @@
|
||||
### ~hint
|
||||

|
||||
|
||||
For another device like a smartphone to use any of the Bluetooth "services" which the micro:bit has, it must first be [paired with the micro:bit](/reference/bluetooth/bluetooth-pairing). Once paired, the other device may connect to the micro:bit and exchange data relating to many of the micro:bit's features.
|
||||
For another device like a smartphone to use any of the Bluetooth "services" which the @boardname@ has, it must first be [paired with the @boardname@](/reference/bluetooth/bluetooth-pairing). Once paired, the other device may connect to the @boardname@ and exchange data relating to many of the @boardname@'s features.
|
||||
|
||||
### ~
|
||||
|
||||
The Bluetooth accelerometer service allows another device such as a smartphone to wirelessly receive data from the micro:bit's accelerometer. An accelerometer detects motion. More precisely, it measures acceleration in one or more of three directions which we call X, Y and Z.
|
||||
The Bluetooth accelerometer service allows another device such as a smartphone to wirelessly receive data from the @boardname@'s accelerometer. An accelerometer detects motion. More precisely, it measures acceleration in one or more of three directions which we call X, Y and Z.
|
||||
|
||||
Using the Bluetooth accelerometer service you could, for example, create a smartphone application which makes a loud noise whenever your micro:bit (or the important thing you've attached it to) is moved. Or you could use your micro:bit to control the movement of a cartoon character in a game on your smartphone just by tilting the micro:bit in the direction you want the character to move in.
|
||||
Using the Bluetooth accelerometer service you could, for example, create a smartphone application which makes a loud noise whenever your @boardname@ (or the important thing you've attached it to) is moved. Or you could use your @boardname@ to control the movement of a cartoon character in a game on your smartphone just by tilting the @boardname@ in the direction you want the character to move in.
|
||||
|
||||
No additional code is needed on the micro:bit to use the Bluetooth accelerometer service from another device.
|
||||
No additional code is needed on the @boardname@ to use the Bluetooth accelerometer service from another device.
|
||||
|
||||
```sig
|
||||
bluetooth.startAccelerometerService();
|
||||
@@ -31,11 +31,11 @@ http://www.youtube.com/watch?v=aep_GVowKfs#t=18s
|
||||
|
||||
### Advanced
|
||||
|
||||
For more advanced information on the micro:bit Bluetooth accelerometer service including information on using a smartphone, see the [Lancaster University micro:bit runtime technical documentation](http://lancaster-university.github.io/microbit-docs/ble/accelerometer-service/)
|
||||
For more advanced information on the @boardname@ Bluetooth accelerometer service including information on using a smartphone, see the [Lancaster University @boardname@ runtime technical documentation](http://lancaster-university.github.io/microbit-docs/ble/accelerometer-service/)
|
||||
|
||||
### See also
|
||||
|
||||
[About Bluetooth](/reference/bluetooth/about-bluetooth), [micro:bit Bluetooth profile overview ](http://lancaster-university.github.io/microbit-docs/ble/profile/), [micro:bit Bluetooth profile reference](http://lancaster-university.github.io/microbit-docs/resources/bluetooth/microbit-profile-V1.9-Level-2.pdf), [Bluetooth on micro:bit resources](http://bluetooth-mdw.blogspot.co.uk/p/bbc-microbit.html), [Bluetooth SIG](https://www.bluetooth.com)
|
||||
[About Bluetooth](/reference/bluetooth/about-bluetooth), [@boardname@ Bluetooth profile overview ](http://lancaster-university.github.io/microbit-docs/ble/profile/), [@boardname@ Bluetooth profile reference](http://lancaster-university.github.io/microbit-docs/resources/bluetooth/microbit-profile-V1.9-Level-2.pdf), [Bluetooth on @boardname@ resources](http://bluetooth-mdw.blogspot.co.uk/p/bbc-microbit.html), [Bluetooth SIG](https://www.bluetooth.com)
|
||||
|
||||
```package
|
||||
bluetooth
|
||||
|
||||
@@ -3,19 +3,19 @@
|
||||
### ~hint
|
||||

|
||||
|
||||
For another device like a smartphone to use any of the Bluetooth "services" which the micro:bit has, it must first be [paired with the micro:bit](/reference/bluetooth/bluetooth-pairing). Once paired, the other device may connect to the micro:bit and exchange data relating to many of the micro:bit's features.
|
||||
For another device like a smartphone to use any of the Bluetooth "services" which the @boardname@ has, it must first be [paired with the @boardname@](/reference/bluetooth/bluetooth-pairing). Once paired, the other device may connect to the @boardname@ and exchange data relating to many of the @boardname@'s features.
|
||||
|
||||
### ~
|
||||
|
||||
The Bluetooth button service makes it possible for another device such as a smartphone to be notified wirelessly whenever a button on the front of a micro:bit is pressed. Each of the two micro:bit buttons can be in one of three possible states:
|
||||
The Bluetooth button service makes it possible for another device such as a smartphone to be notified wirelessly whenever a button on the front of a @boardname@ is pressed. Each of the two @boardname@ buttons can be in one of three possible states:
|
||||
|
||||
* Not pressed
|
||||
* Pressed
|
||||
* Long press - pressed and held down for at least 2 seconds
|
||||
|
||||
The button service allows you to make other things which are connected to your micro:bit using Bluetooth respond in some way when you press either of the buttons. You could, for example, hide your smartphone somewhere in the room and have it make an amusing noise when you press either of the buttons on your micro:bit. We'll leave it to you to decide what would be amusing.
|
||||
The button service allows you to make other things which are connected to your @boardname@ using Bluetooth respond in some way when you press either of the buttons. You could, for example, hide your smartphone somewhere in the room and have it make an amusing noise when you press either of the buttons on your @boardname@. We'll leave it to you to decide what would be amusing.
|
||||
|
||||
No additional code is needed on the micro:bit to use the Bluetooth button service from another device.
|
||||
No additional code is needed on the @boardname@ to use the Bluetooth button service from another device.
|
||||
|
||||
```sig
|
||||
bluetooth.startButtonService();
|
||||
@@ -35,11 +35,11 @@ http://www.youtube.com/watch?v=aep_GVowKfs
|
||||
|
||||
### Advanced
|
||||
|
||||
For more advanced information on the micro:bit Bluetooth button service including information on using a smartphone, see the [Lancaster University micro:bit runtime technical documentation](http://lancaster-university.github.io/microbit-docs/ble/button-service/)
|
||||
For more advanced information on the @boardname@ Bluetooth button service including information on using a smartphone, see the [Lancaster University @boardname@ runtime technical documentation](http://lancaster-university.github.io/microbit-docs/ble/button-service/)
|
||||
|
||||
### See also
|
||||
|
||||
[About Bluetooth](/reference/bluetooth/about-bluetooth), [micro:bit Bluetooth profile overview ](http://lancaster-university.github.io/microbit-docs/ble/profile/), [micro:bit Bluetooth profile reference](http://lancaster-university.github.io/microbit-docs/resources/bluetooth/microbit-profile-V1.9-Level-2.pdf), [Bluetooth on micro:bit resources](http://bluetooth-mdw.blogspot.co.uk/p/bbc-microbit.html), [Bluetooth SIG](https://www.bluetooth.com)
|
||||
[About Bluetooth](/reference/bluetooth/about-bluetooth), [@boardname@ Bluetooth profile overview ](http://lancaster-university.github.io/microbit-docs/ble/profile/), [@boardname@ Bluetooth profile reference](http://lancaster-university.github.io/microbit-docs/resources/bluetooth/microbit-profile-V1.9-Level-2.pdf), [Bluetooth on @boardname@ resources](http://bluetooth-mdw.blogspot.co.uk/p/bbc-microbit.html), [Bluetooth SIG](https://www.bluetooth.com)
|
||||
|
||||
```package
|
||||
bluetooth
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
### ~hint
|
||||

|
||||
|
||||
For another device like a smartphone to use any of the Bluetooth "services" which the micro:bit has, it must first be [paired with the micro:bit](/reference/bluetooth/bluetooth-pairing). Once paired, the other device may connect to the micro:bit and exchange data relating to many of the micro:bit's features.
|
||||
For another device like a smartphone to use any of the Bluetooth "services" which the @boardname@ has, it must first be [paired with the @boardname@](/reference/bluetooth/bluetooth-pairing). Once paired, the other device may connect to the @boardname@ and exchange data relating to many of the @boardname@'s features.
|
||||
|
||||
### ~
|
||||
|
||||
The Bluetooth IO pin service makes it possible for another device such as a smartphone to communicate with other electronic 'things' connected to a micro:bit's edge connector. You could for example, use your smartphone to switch on or off a light which is connected to the micro:bit or your smartphone could receive data collected from a sensor connected to the micro:bit. In fact you could do both of these things at the same time since the Bluetooth IO pin service lets you interact with multiple 'pins' on the edge conector in different ways all at the same time.
|
||||
The Bluetooth IO pin service makes it possible for another device such as a smartphone to communicate with other electronic 'things' connected to a @boardname@'s edge connector. You could for example, use your smartphone to switch on or off a light which is connected to the @boardname@ or your smartphone could receive data collected from a sensor connected to the @boardname@. In fact you could do both of these things at the same time since the Bluetooth IO pin service lets you interact with multiple 'pins' on the edge conector in different ways all at the same time.
|
||||
|
||||
No additional code is needed on the micro:bit to use the Bluetooth IO pin service from another device.
|
||||
No additional code is needed on the @boardname@ to use the Bluetooth IO pin service from another device.
|
||||
|
||||
```sig
|
||||
bluetooth.startIOPinService();
|
||||
@@ -29,11 +29,11 @@ http://www.youtube.com/watch?v=aep_GVowKfs
|
||||
|
||||
### Advanced
|
||||
|
||||
For more advanced information on the micro:bit Bluetooth IO pin service including information on using a smartphone, see the [Lancaster University micro:bit runtime technical documentation](http://lancaster-university.github.io/microbit-docs/ble/iopin-service/)
|
||||
For more advanced information on the @boardname@ Bluetooth IO pin service including information on using a smartphone, see the [Lancaster University @boardname@ runtime technical documentation](http://lancaster-university.github.io/microbit-docs/ble/iopin-service/)
|
||||
|
||||
### See also
|
||||
|
||||
[About Bluetooth](/reference/bluetooth/about-bluetooth), [micro:bit Bluetooth profile overview ](http://lancaster-university.github.io/microbit-docs/ble/profile/), [micro:bit Bluetooth profile reference](http://lancaster-university.github.io/microbit-docs/resources/bluetooth/microbit-profile-V1.9-Level-2.pdf), [Bluetooth on micro:bit resources](http://bluetooth-mdw.blogspot.co.uk/p/bbc-microbit.html), [Bluetooth SIG](https://www.bluetooth.com)
|
||||
[About Bluetooth](/reference/bluetooth/about-bluetooth), [@boardname@ Bluetooth profile overview ](http://lancaster-university.github.io/microbit-docs/ble/profile/), [@boardname@ Bluetooth profile reference](http://lancaster-university.github.io/microbit-docs/resources/bluetooth/microbit-profile-V1.9-Level-2.pdf), [Bluetooth on @boardname@ resources](http://bluetooth-mdw.blogspot.co.uk/p/bbc-microbit.html), [Bluetooth SIG](https://www.bluetooth.com)
|
||||
|
||||
```package
|
||||
bluetooth
|
||||
|
||||
@@ -3,15 +3,15 @@
|
||||
### ~hint
|
||||

|
||||
|
||||
For another device like a smartphone to use any of the Bluetooth "services" which the micro:bit has, it must first be [paired with the micro:bit](/reference/bluetooth/bluetooth-pairing). Once paired, the other device may connect to the micro:bit and exchange data relating to many of the micro:bit's features.
|
||||
For another device like a smartphone to use any of the Bluetooth "services" which the @boardname@ has, it must first be [paired with the @boardname@](/reference/bluetooth/bluetooth-pairing). Once paired, the other device may connect to the @boardname@ and exchange data relating to many of the @boardname@'s features.
|
||||
|
||||
### ~
|
||||
|
||||
The Bluetooth LED service allows another device such as a smartphone to send short text strings or patterns over a Bluetooth connection to a micro:bit for display on its LED matrix. Text will scroll across the micro:bit and the speed at which it scrolls can also be controlled using the Bluetooth LED service. Devices using the LED service may also read the current state of the micro:bit's LED matrix.
|
||||
The Bluetooth LED service allows another device such as a smartphone to send short text strings or patterns over a Bluetooth connection to a @boardname@ for display on its LED matrix. Text will scroll across the @boardname@ and the speed at which it scrolls can also be controlled using the Bluetooth LED service. Devices using the LED service may also read the current state of the @boardname@'s LED matrix.
|
||||
|
||||
So you could, for example, draw a smiley face in a smartphone app and at the press of a button, have it magically appear on your micro:bit on the other side of the room. Or you could program your smartphone to send a message to your micro:bit whenever your phone receives an email, SMS or social media message so you could wear your micro:bit like a smart watch and leave your phone in your bag.
|
||||
So you could, for example, draw a smiley face in a smartphone app and at the press of a button, have it magically appear on your @boardname@ on the other side of the room. Or you could program your smartphone to send a message to your @boardname@ whenever your phone receives an email, SMS or social media message so you could wear your @boardname@ like a smart watch and leave your phone in your bag.
|
||||
|
||||
No additional code is needed on the micro:bit to use the Bluetooth LED service from another device.
|
||||
No additional code is needed on the @boardname@ to use the Bluetooth LED service from another device.
|
||||
|
||||
```sig
|
||||
bluetooth.startLEDService();
|
||||
@@ -31,11 +31,11 @@ http://www.youtube.com/watch?v=aep_GVowKfs
|
||||
|
||||
### Advanced
|
||||
|
||||
For more advanced information on the micro:bit Bluetooth LED service including information on using a smartphone, see the [Lancaster University micro:bit runtime technical documentation](http://lancaster-university.github.io/microbit-docs/ble/led-service/)
|
||||
For more advanced information on the @boardname@ Bluetooth LED service including information on using a smartphone, see the [Lancaster University @boardname@ runtime technical documentation](http://lancaster-university.github.io/microbit-docs/ble/led-service/)
|
||||
|
||||
### See also
|
||||
|
||||
[About Bluetooth](/reference/bluetooth/about-bluetooth), [micro:bit Bluetooth profile overview ](http://lancaster-university.github.io/microbit-docs/ble/profile/), [micro:bit Bluetooth profile reference](http://lancaster-university.github.io/microbit-docs/resources/bluetooth/microbit-profile-V1.9-Level-2.pdf), [Bluetooth on micro:bit resources](http://bluetooth-mdw.blogspot.co.uk/p/bbc-microbit.html), [Bluetooth SIG](https://www.bluetooth.com)
|
||||
[About Bluetooth](/reference/bluetooth/about-bluetooth), [@boardname@ Bluetooth profile overview ](http://lancaster-university.github.io/microbit-docs/ble/profile/), [@boardname@ Bluetooth profile reference](http://lancaster-university.github.io/microbit-docs/resources/bluetooth/microbit-profile-V1.9-Level-2.pdf), [Bluetooth on @boardname@ resources](http://bluetooth-mdw.blogspot.co.uk/p/bbc-microbit.html), [Bluetooth SIG](https://www.bluetooth.com)
|
||||
|
||||
```package
|
||||
bluetooth
|
||||
|
||||
@@ -3,15 +3,15 @@
|
||||
### ~hint
|
||||

|
||||
|
||||
For another device like a smartphone to use any of the Bluetooth "services" which the micro:bit has, it must first be [paired with the micro:bit](/reference/bluetooth/bluetooth-pairing). Once paired, the other device may connect to the micro:bit and exchange data relating to many of the micro:bit's features.
|
||||
For another device like a smartphone to use any of the Bluetooth "services" which the @boardname@ has, it must first be [paired with the @boardname@](/reference/bluetooth/bluetooth-pairing). Once paired, the other device may connect to the @boardname@ and exchange data relating to many of the @boardname@'s features.
|
||||
|
||||
### ~
|
||||
|
||||
The Bluetooth magnetometer service allows another device such as a smartphone to wirelessly receive data from the micro:bit's magnetometer. The magnetometer measures the strength and direction of magnetic fields including the earth's and so it can be used as a digital compass and indicate the way the micro:bit is pointing relative to magnetic north.
|
||||
The Bluetooth magnetometer service allows another device such as a smartphone to wirelessly receive data from the @boardname@'s magnetometer. The magnetometer measures the strength and direction of magnetic fields including the earth's and so it can be used as a digital compass and indicate the way the @boardname@ is pointing relative to magnetic north.
|
||||
|
||||
Using the Bluetooth magnetometer service you could, for example, create a smartphone application which displays your direction of travel, updating it in real time.
|
||||
|
||||
No additional code is needed on the micro:bit to use the Bluetooth magnetometer service from another device.
|
||||
No additional code is needed on the @boardname@ to use the Bluetooth magnetometer service from another device.
|
||||
|
||||
```sig
|
||||
bluetooth.startMagnetometerService();
|
||||
@@ -31,11 +31,11 @@ http://www.youtube.com/watch?v=C_0VL4Gp4_U
|
||||
|
||||
### Advanced
|
||||
|
||||
For more advanced information on the micro:bit Bluetooth magnetometer service including information on using a smartphone, see the [Lancaster University micro:bit runtime technical documentation](http://lancaster-university.github.io/microbit-docs/ble/magnetometer-service/)
|
||||
For more advanced information on the @boardname@ Bluetooth magnetometer service including information on using a smartphone, see the [Lancaster University @boardname@ runtime technical documentation](http://lancaster-university.github.io/microbit-docs/ble/magnetometer-service/)
|
||||
|
||||
### See also
|
||||
|
||||
[About Bluetooth](/reference/bluetooth/about-bluetooth), [micro:bit Bluetooth profile overview ](http://lancaster-university.github.io/microbit-docs/ble/profile/), [micro:bit Bluetooth profile reference](http://lancaster-university.github.io/microbit-docs/resources/bluetooth/microbit-profile-V1.9-Level-2.pdf), [Bluetooth on micro:bit resources](http://bluetooth-mdw.blogspot.co.uk/p/bbc-microbit.html), [Bluetooth SIG](https://www.bluetooth.com)
|
||||
[About Bluetooth](/reference/bluetooth/about-bluetooth), [@boardname@ Bluetooth profile overview ](http://lancaster-university.github.io/microbit-docs/ble/profile/), [@boardname@ Bluetooth profile reference](http://lancaster-university.github.io/microbit-docs/resources/bluetooth/microbit-profile-V1.9-Level-2.pdf), [Bluetooth on @boardname@ resources](http://bluetooth-mdw.blogspot.co.uk/p/bbc-microbit.html), [Bluetooth SIG](https://www.bluetooth.com)
|
||||
|
||||
|
||||
```package
|
||||
|
||||
@@ -3,15 +3,15 @@
|
||||
### ~hint
|
||||

|
||||
|
||||
For another device like a smartphone to use any of the Bluetooth "services" which the micro:bit has, it must first be [paired with the micro:bit](/reference/bluetooth/bluetooth-pairing). Once paired, the other device may connect to the micro:bit and exchange data relating to many of the micro:bit's features.
|
||||
For another device like a smartphone to use any of the Bluetooth "services" which the @boardname@ has, it must first be [paired with the @boardname@](/reference/bluetooth/bluetooth-pairing). Once paired, the other device may connect to the @boardname@ and exchange data relating to many of the @boardname@'s features.
|
||||
|
||||
### ~
|
||||
|
||||
A micro:bit is able to provide a rough measure of the current environmental temperature. It's an approximation only as in fact the temperature value is inferred from the temperature of its main processor. The Bluetooth temperature service allows another device such as a smartphone to wirelessly find out the micro:bit's current temperature reading or to receive a constant stream of temperature data values. Temperature values are expressed in degrees celsius.
|
||||
A @boardname@ is able to provide a rough measure of the current environmental temperature. It's an approximation only as in fact the temperature value is inferred from the temperature of its main processor. The Bluetooth temperature service allows another device such as a smartphone to wirelessly find out the @boardname@'s current temperature reading or to receive a constant stream of temperature data values. Temperature values are expressed in degrees celsius.
|
||||
|
||||
Using the Bluetooth temperature service you could turn your smartphone or tablet into a graphical thermometer using your micro:bit as the sensor.
|
||||
Using the Bluetooth temperature service you could turn your smartphone or tablet into a graphical thermometer using your @boardname@ as the sensor.
|
||||
|
||||
No additional code is needed on the micro:bit to use the Bluetooth temperature service from another device.
|
||||
No additional code is needed on the @boardname@ to use the Bluetooth temperature service from another device.
|
||||
|
||||
```sig
|
||||
bluetooth.startTemperatureService();
|
||||
@@ -31,11 +31,11 @@ http://www.youtube.com/watch?v=aep_GVowKfs
|
||||
|
||||
### Advanced
|
||||
|
||||
For more advanced information on the micro:bit Bluetooth temperature service including information on using a smartphone, see the [Lancaster University micro:bit runtime technical documentation](http://lancaster-university.github.io/microbit-docs/ble/temperature-service/)
|
||||
For more advanced information on the @boardname@ Bluetooth temperature service including information on using a smartphone, see the [Lancaster University @boardname@ runtime technical documentation](http://lancaster-university.github.io/microbit-docs/ble/temperature-service/)
|
||||
|
||||
### See also
|
||||
|
||||
[About Bluetooth](/reference/bluetooth/about-bluetooth), [micro:bit Bluetooth profile overview ](http://lancaster-university.github.io/microbit-docs/ble/profile/), [micro:bit Bluetooth profile reference](http://lancaster-university.github.io/microbit-docs/resources/bluetooth/microbit-profile-V1.9-Level-2.pdf), [Bluetooth on micro:bit resources](http://bluetooth-mdw.blogspot.co.uk/p/bbc-microbit.html), [Bluetooth SIG](https://www.bluetooth.com)
|
||||
[About Bluetooth](/reference/bluetooth/about-bluetooth), [@boardname@ Bluetooth profile overview ](http://lancaster-university.github.io/microbit-docs/ble/profile/), [@boardname@ Bluetooth profile reference](http://lancaster-university.github.io/microbit-docs/resources/bluetooth/microbit-profile-V1.9-Level-2.pdf), [Bluetooth on @boardname@ resources](http://bluetooth-mdw.blogspot.co.uk/p/bbc-microbit.html), [Bluetooth SIG](https://www.bluetooth.com)
|
||||
|
||||
|
||||
```package
|
||||
|
||||
@@ -3,17 +3,17 @@
|
||||
### ~hint
|
||||

|
||||
|
||||
For another device like a smartphone to use any of the Bluetooth "services" which the micro:bit has, it must first be [paired with the micro:bit](/reference/bluetooth/bluetooth-pairing). Once paired, the other device may connect to the micro:bit and exchange data relating to many of the micro:bit's features.
|
||||
For another device like a smartphone to use any of the Bluetooth "services" which the @boardname@ has, it must first be [paired with the @boardname@](/reference/bluetooth/bluetooth-pairing). Once paired, the other device may connect to the @boardname@ and exchange data relating to many of the @boardname@'s features.
|
||||
|
||||
### ~
|
||||
|
||||
The Bluetooth UART service allows another device such as a smartphone to exchange any data it wants to with the micro:bit, in small chunks which are intended to be joined together. [UART[(https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter) stands for Universal Asynchronous Receiver Transmitter and is one way in which serial data communications can be performed, usually between two devices connected by a physical, wired connection. The Bluetooth UART service emulates the behaviour of a physical UART system and allows the exchange of a maximum of 20 bytes of data at a time in either direction.
|
||||
The Bluetooth UART service allows another device such as a smartphone to exchange any data it wants to with the @boardname@, in small chunks which are intended to be joined together. [UART[(https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter) stands for Universal Asynchronous Receiver Transmitter and is one way in which serial data communications can be performed, usually between two devices connected by a physical, wired connection. The Bluetooth UART service emulates the behaviour of a physical UART system and allows the exchange of a maximum of 20 bytes of data at a time in either direction.
|
||||
|
||||
When this service is used, the micro:bit sets up a 60 byte buffer and data it receives will be accumulated in the buffer until it is full. When using the UART service from your micro:bit code, you can indicate a special character which will be used to mean that the entire message in at most three chunks has now been sent by the other, connected device, at which point the micro:bit will release the entire contents of its buffer to any code trying to read it. In other words this special character, known as a 'delimiter' is used by the device connected to the micro:bit to mean "I've sent my whole message, you can now use it".
|
||||
When this service is used, the @boardname@ sets up a 60 byte buffer and data it receives will be accumulated in the buffer until it is full. When using the UART service from your @boardname@ code, you can indicate a special character which will be used to mean that the entire message in at most three chunks has now been sent by the other, connected device, at which point the @boardname@ will release the entire contents of its buffer to any code trying to read it. In other words this special character, known as a 'delimiter' is used by the device connected to the @boardname@ to mean "I've sent my whole message, you can now use it".
|
||||
|
||||
You could use the UART service for many things. It doesn't care what you put in messages which makes it very flexible. You could create a guessing game, with questions and answers passing between micro:bit and a smartphone or you could connect a camera to the micro:bit and transmit image data obtained from the edge connector, in chunks over Bluetooth to a smartphone. There are a great many possibilities.
|
||||
You could use the UART service for many things. It doesn't care what you put in messages which makes it very flexible. You could create a guessing game, with questions and answers passing between @boardname@ and a smartphone or you could connect a camera to the @boardname@ and transmit image data obtained from the edge connector, in chunks over Bluetooth to a smartphone. There are a great many possibilities.
|
||||
|
||||
To use the Bluetooth UART service from another device you'll need additional micro:bit code which reads and uses data from the UART buffer and / or writes data to the buffer for transmission over Bluetooth to another device.
|
||||
To use the Bluetooth UART service from another device you'll need additional @boardname@ code which reads and uses data from the UART buffer and / or writes data to the buffer for transmission over Bluetooth to another device.
|
||||
|
||||
```sig
|
||||
bluetooth.startUartService();
|
||||
@@ -33,11 +33,11 @@ https://www.youtube.com/watch?v=PgGeWddMAZ0
|
||||
|
||||
### Advanced
|
||||
|
||||
For more advanced information on the micro:bit Bluetooth UART service including information on using a smartphone, see the [Lancaster University micro:bit runtime technical documentation](http://lancaster-university.github.io/microbit-docs/ble/uart-service/)
|
||||
For more advanced information on the @boardname@ Bluetooth UART service including information on using a smartphone, see the [Lancaster University @boardname@ runtime technical documentation](http://lancaster-university.github.io/microbit-docs/ble/uart-service/)
|
||||
|
||||
### See also
|
||||
|
||||
[About Bluetooth](/reference/bluetooth/about-bluetooth), [micro:bit Bluetooth profile overview ](http://lancaster-university.github.io/microbit-docs/ble/profile/), [micro:bit Bluetooth profile reference](http://lancaster-university.github.io/microbit-docs/resources/bluetooth/microbit-profile-V1.9-Level-2.pdf), [Bluetooth on micro:bit resources](http://bluetooth-mdw.blogspot.co.uk/p/bbc-microbit.html), [Bluetooth SIG](https://www.bluetooth.com)
|
||||
[About Bluetooth](/reference/bluetooth/about-bluetooth), [@boardname@ Bluetooth profile overview ](http://lancaster-university.github.io/microbit-docs/ble/profile/), [@boardname@ Bluetooth profile reference](http://lancaster-university.github.io/microbit-docs/resources/bluetooth/microbit-profile-V1.9-Level-2.pdf), [Bluetooth on @boardname@ resources](http://bluetooth-mdw.blogspot.co.uk/p/bbc-microbit.html), [Bluetooth SIG](https://www.bluetooth.com)
|
||||
|
||||
```package
|
||||
bluetooth
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
### ~hint
|
||||

|
||||
|
||||
For another device like a smartphone to use any of the Bluetooth "services" which the micro:bit has, it must first be [paired with the micro:bit](/reference/bluetooth/bluetooth-pairing). Once paired, the other device may connect to the micro:bit and exchange data relating to many of the micro:bit's features.
|
||||
For another device like a smartphone to use any of the Bluetooth "services" which the @boardname@ has, it must first be [paired with the @boardname@](/reference/bluetooth/bluetooth-pairing). Once paired, the other device may connect to the @boardname@ and exchange data relating to many of the @boardname@'s features.
|
||||
|
||||
### ~
|
||||
|
||||
The [Bluetooth UART service](/reference/bluetooth/start-uart-service) allows another device such as a smartphone to exchange any data it wants to with the micro:bit, in small chunks.
|
||||
The [Bluetooth UART service](/reference/bluetooth/start-uart-service) allows another device such as a smartphone to exchange any data it wants to with the @boardname@, in small chunks.
|
||||
|
||||
With the Bluetooth UART service running, this block allows a micro:bit to read data which has been received from a Bluetooth connected device, terminating reading and returning the value obtained as soon as a specified delimiter character is encountered. This means that connected devices can send data to the micro:bit and indicate that the complete message has been sent by appending the message with the delimiter character.
|
||||
With the Bluetooth UART service running, this block allows a @boardname@ to read data which has been received from a Bluetooth connected device, terminating reading and returning the value obtained as soon as a specified delimiter character is encountered. This means that connected devices can send data to the @boardname@ and indicate that the complete message has been sent by appending the message with the delimiter character.
|
||||
|
||||
```sig
|
||||
bluetooth.uartReadUntil("");
|
||||
@@ -41,11 +41,11 @@ https://www.youtube.com/watch?v=PgGeWddMAZ0
|
||||
|
||||
### Advanced
|
||||
|
||||
For more advanced information on the micro:bit Bluetooth UART service including information on using a smartphone, see the [Lancaster University micro:bit runtime technical documentation](http://lancaster-university.github.io/microbit-docs/ble/uart-service/)
|
||||
For more advanced information on the @boardname@ Bluetooth UART service including information on using a smartphone, see the [Lancaster University @boardname@ runtime technical documentation](http://lancaster-university.github.io/microbit-docs/ble/uart-service/)
|
||||
|
||||
### See also
|
||||
|
||||
[About Bluetooth](/reference/bluetooth/about-bluetooth), [micro:bit Bluetooth profile overview ](http://lancaster-university.github.io/microbit-docs/ble/profile/), [micro:bit Bluetooth profile reference](http://lancaster-university.github.io/microbit-docs/resources/bluetooth/microbit-profile-V1.9-Level-2.pdf), [Bluetooth on micro:bit resources](http://bluetooth-mdw.blogspot.co.uk/p/bbc-microbit.html), [Bluetooth SIG](https://www.bluetooth.com)
|
||||
[About Bluetooth](/reference/bluetooth/about-bluetooth), [@boardname@ Bluetooth profile overview ](http://lancaster-university.github.io/microbit-docs/ble/profile/), [@boardname@ Bluetooth profile reference](http://lancaster-university.github.io/microbit-docs/resources/bluetooth/microbit-profile-V1.9-Level-2.pdf), [Bluetooth on @boardname@ resources](http://bluetooth-mdw.blogspot.co.uk/p/bbc-microbit.html), [Bluetooth SIG](https://www.bluetooth.com)
|
||||
|
||||
```package
|
||||
bluetooth
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
### ~hint
|
||||

|
||||
|
||||
For another device like a smartphone to use any of the Bluetooth "services" which the micro:bit has, it must first be [paired with the micro:bit](/reference/bluetooth/bluetooth-pairing). Once paired, the other device may connect to the micro:bit and exchange data relating to many of the micro:bit's features.
|
||||
For another device like a smartphone to use any of the Bluetooth "services" which the @boardname@ has, it must first be [paired with the @boardname@](/reference/bluetooth/bluetooth-pairing). Once paired, the other device may connect to the @boardname@ and exchange data relating to many of the @boardname@'s features.
|
||||
|
||||
### ~
|
||||
|
||||
The [Bluetooth UART service](/reference/bluetooth/start-uart-service) allows another device such as a smartphone to exchange any data it wants to with the micro:bit, in small chunks.
|
||||
The [Bluetooth UART service](/reference/bluetooth/start-uart-service) allows another device such as a smartphone to exchange any data it wants to with the @boardname@, in small chunks.
|
||||
|
||||
With the Bluetooth UART service running, this block allows a micro:bit to send data to a Bluetooth connected device.
|
||||
With the Bluetooth UART service running, this block allows a @boardname@ to send data to a Bluetooth connected device.
|
||||
|
||||
```sig
|
||||
bluetooth.uartWriteNumber(42);
|
||||
@@ -17,11 +17,11 @@ bluetooth.uartWriteNumber(42);
|
||||
|
||||
### Advanced
|
||||
|
||||
For more advanced information on the micro:bit Bluetooth UART service including information on using a smartphone, see the [Lancaster University micro:bit runtime technical documentation](http://lancaster-university.github.io/microbit-docs/ble/uart-service/)
|
||||
For more advanced information on the @boardname@ Bluetooth UART service including information on using a smartphone, see the [Lancaster University @boardname@ runtime technical documentation](http://lancaster-university.github.io/microbit-docs/ble/uart-service/)
|
||||
|
||||
### See also
|
||||
|
||||
[About Bluetooth](/reference/bluetooth/about-bluetooth), [micro:bit Bluetooth profile overview ](http://lancaster-university.github.io/microbit-docs/ble/profile/), [micro:bit Bluetooth profile reference](http://lancaster-university.github.io/microbit-docs/resources/bluetooth/microbit-profile-V1.9-Level-2.pdf), [Bluetooth on micro:bit resources](http://bluetooth-mdw.blogspot.co.uk/p/bbc-microbit.html), [Bluetooth SIG](https://www.bluetooth.com)
|
||||
[About Bluetooth](/reference/bluetooth/about-bluetooth), [@boardname@ Bluetooth profile overview ](http://lancaster-university.github.io/microbit-docs/ble/profile/), [@boardname@ Bluetooth profile reference](http://lancaster-university.github.io/microbit-docs/resources/bluetooth/microbit-profile-V1.9-Level-2.pdf), [Bluetooth on @boardname@ resources](http://bluetooth-mdw.blogspot.co.uk/p/bbc-microbit.html), [Bluetooth SIG](https://www.bluetooth.com)
|
||||
|
||||
```package
|
||||
bluetooth
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
### ~hint
|
||||

|
||||
|
||||
For another device like a smartphone to use any of the Bluetooth "services" which the micro:bit has, it must first be [paired with the micro:bit](/reference/bluetooth/bluetooth-pairing). Once paired, the other device may connect to the micro:bit and exchange data relating to many of the micro:bit's features.
|
||||
For another device like a smartphone to use any of the Bluetooth "services" which the @boardname@ has, it must first be [paired with the @boardname@](/reference/bluetooth/bluetooth-pairing). Once paired, the other device may connect to the @boardname@ and exchange data relating to many of the @boardname@'s features.
|
||||
|
||||
### ~
|
||||
|
||||
The [Bluetooth UART service](/reference/bluetooth/start-uart-service) allows another device such as a smartphone to exchange any data it wants to with the micro:bit, in small chunks.
|
||||
The [Bluetooth UART service](/reference/bluetooth/start-uart-service) allows another device such as a smartphone to exchange any data it wants to with the @boardname@, in small chunks.
|
||||
|
||||
With the Bluetooth UART service running, this block allows a micro:bit to send data to a Bluetooth connected device.
|
||||
With the Bluetooth UART service running, this block allows a @boardname@ to send data to a Bluetooth connected device.
|
||||
|
||||
```sig
|
||||
bluetooth.uartWriteString("");
|
||||
@@ -40,11 +40,11 @@ https://www.youtube.com/watch?v=PgGeWddMAZ0
|
||||
|
||||
### Advanced
|
||||
|
||||
For more advanced information on the micro:bit Bluetooth UART service including information on using a smartphone, see the [Lancaster University micro:bit runtime technical documentation](http://lancaster-university.github.io/microbit-docs/ble/uart-service/)
|
||||
For more advanced information on the @boardname@ Bluetooth UART service including information on using a smartphone, see the [Lancaster University @boardname@ runtime technical documentation](http://lancaster-university.github.io/microbit-docs/ble/uart-service/)
|
||||
|
||||
### See also
|
||||
|
||||
[About Bluetooth](/reference/bluetooth/about-bluetooth), [micro:bit Bluetooth profile overview ](http://lancaster-university.github.io/microbit-docs/ble/profile/), [micro:bit Bluetooth profile reference](http://lancaster-university.github.io/microbit-docs/resources/bluetooth/microbit-profile-V1.9-Level-2.pdf), [Bluetooth on micro:bit resources](http://bluetooth-mdw.blogspot.co.uk/p/bbc-microbit.html), [Bluetooth SIG](https://www.bluetooth.com)
|
||||
[About Bluetooth](/reference/bluetooth/about-bluetooth), [@boardname@ Bluetooth profile overview ](http://lancaster-university.github.io/microbit-docs/ble/profile/), [@boardname@ Bluetooth profile reference](http://lancaster-university.github.io/microbit-docs/resources/bluetooth/microbit-profile-V1.9-Level-2.pdf), [Bluetooth on @boardname@ resources](http://bluetooth-mdw.blogspot.co.uk/p/bbc-microbit.html), [Bluetooth SIG](https://www.bluetooth.com)
|
||||
|
||||
```package
|
||||
bluetooth
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
### ~hint
|
||||

|
||||
|
||||
For another device like a smartphone to use any of the Bluetooth "services" which the micro:bit has, it must first be [paired with the micro:bit](/reference/bluetooth/bluetooth-pairing). Once paired, the other device may connect to the micro:bit and exchange data relating to many of the micro:bit's features.
|
||||
For another device like a smartphone to use any of the Bluetooth "services" which the @boardname@ has, it must first be [paired with the @boardname@](/reference/bluetooth/bluetooth-pairing). Once paired, the other device may connect to the @boardname@ and exchange data relating to many of the @boardname@'s features.
|
||||
|
||||
### ~
|
||||
|
||||
The [Bluetooth UART service](/reference/bluetooth/start-uart-service) allows another device such as a smartphone to exchange any data it wants to with the micro:bit, in small chunks.
|
||||
The [Bluetooth UART service](/reference/bluetooth/start-uart-service) allows another device such as a smartphone to exchange any data it wants to with the @boardname@, in small chunks.
|
||||
|
||||
With the Bluetooth UART service running, this block allows a micro:bit to send data to a Bluetooth connected device.
|
||||
With the Bluetooth UART service running, this block allows a @boardname@ to send data to a Bluetooth connected device.
|
||||
|
||||
```sig
|
||||
bluetooth.uartWriteValue("x", 42);
|
||||
@@ -17,11 +17,11 @@ bluetooth.uartWriteValue("x", 42);
|
||||
|
||||
### Advanced
|
||||
|
||||
For more advanced information on the micro:bit Bluetooth UART service including information on using a smartphone, see the [Lancaster University micro:bit runtime technical documentation](http://lancaster-university.github.io/microbit-docs/ble/uart-service/)
|
||||
For more advanced information on the @boardname@ Bluetooth UART service including information on using a smartphone, see the [Lancaster University @boardname@ runtime technical documentation](http://lancaster-university.github.io/microbit-docs/ble/uart-service/)
|
||||
|
||||
### See also
|
||||
|
||||
[About Bluetooth](/reference/bluetooth/about-bluetooth), [micro:bit Bluetooth profile overview ](http://lancaster-university.github.io/microbit-docs/ble/profile/), [micro:bit Bluetooth profile reference](http://lancaster-university.github.io/microbit-docs/resources/bluetooth/microbit-profile-V1.9-Level-2.pdf), [Bluetooth on micro:bit resources](http://bluetooth-mdw.blogspot.co.uk/p/bbc-microbit.html), [Bluetooth SIG](https://www.bluetooth.com)
|
||||
[About Bluetooth](/reference/bluetooth/about-bluetooth), [@boardname@ Bluetooth profile overview ](http://lancaster-university.github.io/microbit-docs/ble/profile/), [@boardname@ Bluetooth profile reference](http://lancaster-university.github.io/microbit-docs/resources/bluetooth/microbit-profile-V1.9-Level-2.pdf), [Bluetooth on @boardname@ resources](http://bluetooth-mdw.blogspot.co.uk/p/bbc-microbit.html), [Bluetooth SIG](https://www.bluetooth.com)
|
||||
|
||||
```package
|
||||
bluetooth
|
||||
|
||||
@@ -7,5 +7,5 @@ control.deviceName();
|
||||
```
|
||||
|
||||
**This is an advanced API.** For more information, see the
|
||||
[micro:bit runtime messageBus documentation](https://lancaster-university.github.io/microbit-docs/ubit/messageBus/).
|
||||
[@boardname@ runtime messageBus documentation](https://lancaster-university.github.io/microbit-docs/ubit/messageBus/).
|
||||
|
||||
|
||||
@@ -7,4 +7,4 @@ control.deviceSerialNumber();
|
||||
```
|
||||
|
||||
**This is an advanced API.** For more information, see the
|
||||
[micro:bit runtime messageBus documentation](https://lancaster-university.github.io/microbit-docs/ubit/messageBus/).
|
||||
[@boardname@ runtime messageBus documentation](https://lancaster-university.github.io/microbit-docs/ubit/messageBus/).
|
||||
|
||||
@@ -7,4 +7,4 @@ control.eventSourceId(EventBusSource.MICROBIT_ID_BUTTON_A);
|
||||
```
|
||||
|
||||
**This is an advanced API.** For more information, see the
|
||||
[micro:bit runtime messageBus documentation](https://lancaster-university.github.io/microbit-docs/ubit/messageBus/)
|
||||
[@boardname@ runtime messageBus documentation](https://lancaster-university.github.io/microbit-docs/ubit/messageBus/)
|
||||
|
||||
@@ -7,4 +7,4 @@ control.eventTimestamp();
|
||||
```
|
||||
|
||||
**This is an advanced API.** For more information, see the
|
||||
[micro:bit runtime messageBus documentation](https://lancaster-university.github.io/microbit-docs/ubit/messageBus/).
|
||||
[@boardname@ runtime messageBus documentation](https://lancaster-university.github.io/microbit-docs/ubit/messageBus/).
|
||||
|
||||
@@ -8,5 +8,5 @@ control.eventValueId(EventBusValue.MICROBIT_EVT_ANY);
|
||||
|
||||
|
||||
**This is an advanced API.** For more information, see the
|
||||
[micro:bit runtime messageBus documentation](https://lancaster-university.github.io/microbit-docs/ubit/messageBus/).
|
||||
[@boardname@ runtime messageBus documentation](https://lancaster-university.github.io/microbit-docs/ubit/messageBus/).
|
||||
|
||||
|
||||
@@ -8,5 +8,5 @@ control.eventValue();
|
||||
|
||||
|
||||
**This is an advanced API.** For more information, see the
|
||||
[micro:bit runtime messageBus documentation](https://lancaster-university.github.io/microbit-docs/ubit/messageBus/).
|
||||
[@boardname@ runtime messageBus documentation](https://lancaster-university.github.io/microbit-docs/ubit/messageBus/).
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ control.inBackground(() => {
|
||||
### ~hint
|
||||
|
||||
For more information, read
|
||||
[The micro:bit - a reactive system](/device/reactive).
|
||||
[The @boardname@ - a reactive system](/device/reactive).
|
||||
It is pretty advanced!
|
||||
|
||||
### ~
|
||||
|
||||
@@ -7,5 +7,5 @@ control.onEvent(control.eventSourceId(EventBusSource.MICROBIT_ID_BUTTON_A), cont
|
||||
```
|
||||
|
||||
**This is an advanced API.** For more information, see the
|
||||
[micro:bit runtime messageBus documentation](https://lancaster-university.github.io/microbit-docs/ubit/messageBus/).
|
||||
[@boardname@ runtime messageBus documentation](https://lancaster-university.github.io/microbit-docs/ubit/messageBus/).
|
||||
|
||||
|
||||
@@ -7,4 +7,4 @@ control.raiseEvent(control.eventSourceId(EventBusSource.MICROBIT_ID_BUTTON_A), c
|
||||
```
|
||||
|
||||
**This is an advanced API.** For more information, see the
|
||||
[micro:bit runtime messageBus documentation](https://lancaster-university.github.io/microbit-docs/ubit/messageBus/)
|
||||
[@boardname@ runtime messageBus documentation](https://lancaster-university.github.io/microbit-docs/ubit/messageBus/)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
Reset the @boardname@ and start the program again.
|
||||
|
||||
This function is like pressing the reset button on the back of the micro:bit.
|
||||
This function is like pressing the reset button on the back of the @boardname@.
|
||||
|
||||
```sig
|
||||
control.reset()
|
||||
@@ -12,7 +12,7 @@ control.reset()
|
||||
|
||||
This program will count as high as you like when you press button `A`.
|
||||
When you get tired of counting, press button `B` to reset the
|
||||
micro:bit and start the program over.
|
||||
@boardname@ and start the program over.
|
||||
|
||||
```blocks
|
||||
let item = 0;
|
||||
@@ -28,7 +28,7 @@ input.onButtonPressed(Button.B, () => {
|
||||
|
||||
#### ~hint
|
||||
|
||||
This program works better on a real micro:bit than in the simulator.
|
||||
This program works better on a real @boardname@ than in the simulator.
|
||||
|
||||
#### ~
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# On Gamepad Button
|
||||
|
||||
Register code to run when the micro:bit receives a command from the paired gamepad.
|
||||
Register code to run when the @boardname@ receives a command from the paired gamepad.
|
||||
|
||||
### ~hint
|
||||
|
||||
@@ -16,7 +16,7 @@ devices.onGamepadButton(MesDpadButtonInfo.ADown, () => {})
|
||||
|
||||
### Parameters
|
||||
|
||||
* ``body``: Action code to run when the the micro:bit receives a command from the paired gamepad.
|
||||
* ``body``: Action code to run when the the @boardname@ receives a command from the paired gamepad.
|
||||
|
||||
### See Also
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Create Big Image
|
||||
|
||||
Make a big [image](/reference/images/image) (picture) for the micro:bit
|
||||
Make a big [image](/reference/images/image) (picture) for the @boardname@
|
||||
[LED screen](/device/screen). The big image made of two squares.
|
||||
Each of the squares is five LEDs on a side, like a regular image.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Create Image
|
||||
|
||||
Make an [image](/reference/images/image) (picture) for the micro:bit
|
||||
Make an [image](/reference/images/image) (picture) for the @boardname@
|
||||
[LED screen](/device/screen).
|
||||
|
||||
```sig
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Image
|
||||
|
||||
An image for the micro:bit screen.
|
||||
An image for the @boardname@ screen.
|
||||
|
||||
### @parent blocks/language
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Show Image
|
||||
|
||||
Show an [image](/reference/images/image) (picture) on the
|
||||
[LED screen](/device/screen). After the micro:bit shows an image, it
|
||||
[LED screen](/device/screen). After the @boardname@ shows an image, it
|
||||
will pause for 400 milliseconds (1000 milliseconds is one second).
|
||||
|
||||
```sig
|
||||
@@ -12,7 +12,7 @@ item.showImage(0);
|
||||
### Parameters
|
||||
|
||||
* an [image](/reference/images/image) (picture). It is usually a square with five LEDs on a side, but it might be wider.
|
||||
* a [number](/reference/types/number) that says how many LEDs from the left of the picture the micro:bit should start. `0` means start at the first **frame** of the picture, `5` means start at the second frame, `10` means start at the third, and so on.
|
||||
* a [number](/reference/types/number) that says how many LEDs from the left of the picture the @boardname@ should start. `0` means start at the first **frame** of the picture, `5` means start at the second frame, `10` means start at the third, and so on.
|
||||
|
||||
### Example: Flip-flopping arrow
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
Get the acceleration value (milli g-force), in one of three specified dimensions.
|
||||
|
||||
Find the acceleration of the micro:bit (how fast it is speeding up or slowing down).
|
||||
Find the acceleration of the @boardname@ (how fast it is speeding up or slowing down).
|
||||
|
||||
```sig
|
||||
input.acceleration(Dimension.X);
|
||||
@@ -23,11 +23,11 @@ A **g** is as much acceleration as you get from Earth's gravity.
|
||||
|
||||
### Returns
|
||||
|
||||
* a [number](/reference/types/number) that means the amount of acceleration. When the micro:bit is lying flat on a surface with the screen pointing up, `x` is `0`, `y` is `0`, and `z` is `-1023`.
|
||||
* a [number](/reference/types/number) that means the amount of acceleration. When the @boardname@ is lying flat on a surface with the screen pointing up, `x` is `0`, `y` is `0`, and `z` is `-1023`.
|
||||
|
||||
### Example: bar chart
|
||||
|
||||
This example shows the acceleration of the micro:bit with a bar graph.
|
||||
This example shows the acceleration of the @boardname@ with a bar graph.
|
||||
|
||||
```blocks
|
||||
basic.forever(() => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Button Is Pressed
|
||||
|
||||
Check whether a button is pressed right now. The micro:bit has two buttons: button `A` and button `B`.
|
||||
Check whether a button is pressed right now. The @boardname@ has two buttons: button `A` and button `B`.
|
||||
|
||||
```sig
|
||||
input.buttonIsPressed(Button.A);
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# Compass Heading
|
||||
|
||||
Find which direction on a compass the micro:bit is facing.
|
||||
Find which direction on a compass the @boardname@ is facing.
|
||||
|
||||
The micro:bit measures the **compass heading** from `0` to `360`
|
||||
The @boardname@ measures the **compass heading** from `0` to `360`
|
||||
degrees with its **magnetometer** chip. Different numbers mean north,
|
||||
east, south, and west.
|
||||
|
||||
@@ -33,7 +33,7 @@ the compass needle on the screen to change the compass heading.
|
||||
### Example: compass
|
||||
|
||||
This program finds the compass heading and then shows a letter
|
||||
that means whether the micro:bit is facing north (N), south (S),
|
||||
that means whether the @boardname@ is facing north (N), south (S),
|
||||
east (E), or west (W).
|
||||
|
||||
```blocks
|
||||
@@ -52,12 +52,12 @@ basic.forever(() => {
|
||||
### Calibration
|
||||
|
||||
Every time you start to use the compass (for example, if you have just
|
||||
turned the micro:bit on), the micro:bit will start to **calibrate**
|
||||
turned the @boardname@ on), the @boardname@ will start to **calibrate**
|
||||
(adjust itself). It will ask you to draw a circle by tilting the
|
||||
micro:bit.
|
||||
@boardname@.
|
||||
|
||||
If you are calibrating or using the compass near metal, it might
|
||||
confuse the micro:bit.
|
||||
confuse the @boardname@.
|
||||
|
||||
### See also
|
||||
|
||||
|
||||
@@ -33,8 +33,8 @@ input.onButtonPressed(Button.B, () => {
|
||||
|
||||
### Example: chart light level
|
||||
|
||||
This program shows the light level with a [bar chart](/reference/led/plot-bar-graph) on the micro:bit screen.
|
||||
If you carry the micro:bit around to different places with different light levels,
|
||||
This program shows the light level with a [bar chart](/reference/led/plot-bar-graph) on the @boardname@ screen.
|
||||
If you carry the @boardname@ around to different places with different light levels,
|
||||
the bar chart will change.
|
||||
|
||||
```blocks
|
||||
|
||||
@@ -8,14 +8,14 @@ input.magneticForce(Dimension.X);
|
||||
|
||||
## ~hint
|
||||
|
||||
The micro:bit measures magnetic force with **microteslas**.
|
||||
The @boardname@ measures magnetic force with **microteslas**.
|
||||
|
||||
## ~
|
||||
|
||||
|
||||
### Parameters
|
||||
|
||||
* ``dimension`` means which direction the micro:bit should measure
|
||||
* ``dimension`` means which direction the @boardname@ should measure
|
||||
magnetic force in: either `Dimension.X` (the left-right direction),
|
||||
`Dimension.Y` (the forward/backward direction), or `Dimension.Z`
|
||||
(the up/down direction)
|
||||
@@ -26,7 +26,7 @@ The micro:bit measures magnetic force with **microteslas**.
|
||||
|
||||
### Example: metal detector
|
||||
|
||||
This program makes the center LED of the micro:bit get brighter when
|
||||
This program makes the center LED of the @boardname@ get brighter when
|
||||
the magnetic force is stronger, and dimmer when it is weaker.
|
||||
|
||||
```blocks
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
Start an [event handler](/reference/event-handler) (part of the
|
||||
program that will run when something happens) This handler works when
|
||||
you do a **gesture** (like shaking the micro:bit).
|
||||
you do a **gesture** (like shaking the @boardname@).
|
||||
|
||||
```sig
|
||||
input.onGesture(Gesture.Shake,() => {
|
||||
@@ -11,11 +11,11 @@ input.onGesture(Gesture.Shake,() => {
|
||||
|
||||
### Parameters
|
||||
|
||||
* ``gesture`` means the way you hold or move the micro:bit. This can be `shake`, `logo up`, `logo down`, `screen up`, `screen down`, `tilt left`, `tilt right`, `free fall`, `3g`, or `6g`.
|
||||
* ``gesture`` means the way you hold or move the @boardname@. This can be `shake`, `logo up`, `logo down`, `screen up`, `screen down`, `tilt left`, `tilt right`, `free fall`, `3g`, or `6g`.
|
||||
|
||||
### Example: random number
|
||||
|
||||
This program shows a number from `0` to `9` when you shake the micro:bit.
|
||||
This program shows a number from `0` to `9` when you shake the @boardname@.
|
||||
|
||||
```blocks
|
||||
input.onGesture(Gesture.Shake,() => {
|
||||
|
||||
@@ -4,12 +4,12 @@ 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 you press pin `0`, `1`, or `2`
|
||||
together with `GND`. When you are using this function in a web
|
||||
browser, click the pins on the screen instead of the ones on the BBC
|
||||
micro:bit.
|
||||
browser, click the pins on the screen instead of the ones on the
|
||||
@boardname@.
|
||||
|
||||
If you hold the `GND` pin with one hand and touch pin `0`, `1`, or `2`
|
||||
with the other, a very small (safe) amount of electricity will flow
|
||||
through your body and back into the micro:bit. This is called
|
||||
through your body and back into the @boardname@. This is called
|
||||
**completing a circuit**. It's like you're a big wire!
|
||||
|
||||
```sig
|
||||
|
||||
@@ -4,12 +4,12 @@ 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 you release pin `0`, `1`, or `2`
|
||||
together with `GND`. When you are using this function in a web
|
||||
browser, click and release the pins on the screen instead of the ones on the BBC
|
||||
micro:bit.
|
||||
browser, click and release the pins on the screen instead of the ones on the
|
||||
@boardname@.
|
||||
|
||||
If you hold the `GND` pin with one hand and touch pin `0`, `1`, or `2`
|
||||
with the other, a very small (safe) amount of electricity will flow
|
||||
through your body and back into the micro:bit. This is called
|
||||
through your body and back into the @boardname@. This is called
|
||||
**completing a circuit**. It's like you're a big wire!
|
||||
|
||||
```sig
|
||||
|
||||
@@ -4,7 +4,7 @@ Find whether the pin you say is pressed or not pressed.
|
||||
|
||||
If you hold the `GND` pin with one hand and touch pin `0`, `1`, or `2` with the other,
|
||||
a very small (safe) amount of electricity will flow through your body and back into
|
||||
the micro:bit. This is called **completing a circuit**. It's like you're a big wire!
|
||||
the @boardname@. This is called **completing a circuit**. It's like you're a big wire!
|
||||
|
||||
```sig
|
||||
input.pinIsPressed(TouchPin.P0);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Rotation
|
||||
|
||||
Find how much the micro:bit is tilted in different directions.
|
||||
Find how much the @boardname@ is tilted in different directions.
|
||||
|
||||
```sig
|
||||
input.rotation(Rotation.Roll);
|
||||
@@ -9,7 +9,7 @@ input.rotation(Rotation.Roll);
|
||||
## ~hint
|
||||
|
||||
The @boardname@ has a part called the **accelerometer** that can
|
||||
check how the micro:bit is moving.
|
||||
check how the @boardname@ is moving.
|
||||
|
||||
## ~
|
||||
|
||||
@@ -21,13 +21,13 @@ check how the micro:bit is moving.
|
||||
|
||||
* a [number](/reference/types/number) that means how much the microbit is tilted in the direction you say, from `0` to `360` degrees
|
||||
|
||||
### Example: micro:bit leveler
|
||||
### Example: @boardname@ leveler
|
||||
|
||||
This program helps you move the @boardname@ until it is level. When
|
||||
it is level, the micro:bit shows a smiley.
|
||||
it is level, the @boardname@ shows a smiley.
|
||||
|
||||
If you are running this program in a browser, you can tilt the
|
||||
micro:bit with your mouse.
|
||||
@boardname@ with your mouse.
|
||||
|
||||
|
||||
```blocks
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Set Accelerometer Range
|
||||
|
||||
Set up the part of the micro:bit that measures
|
||||
Set up the part of the @boardname@ that measures
|
||||
[acceleration](/reference/input/acceleration) (how much the microbit
|
||||
is speeding up or slowing down), in case you need to measure high
|
||||
or low acceleration.
|
||||
@@ -13,12 +13,12 @@ input.setAccelerometerRange(AcceleratorRange.OneG);
|
||||
|
||||
* ``range`` means the biggest number of gravities of acceleration you
|
||||
will be measuring (either `1g`, `2g`, `4g`, or `8g`). Any bigger numbers
|
||||
will be ignored by your micro:bit, both when you are picking a
|
||||
will be ignored by your @boardname@, both when you are picking a
|
||||
number of gravities, and when you are measuring acceleration.
|
||||
|
||||
### Example
|
||||
|
||||
This program says the highest acceleration that your micro:bit
|
||||
This program says the highest acceleration that your @boardname@
|
||||
will measure is 4G. Then it measures acceleration from side to side
|
||||
until you stop the program.
|
||||
|
||||
@@ -31,7 +31,7 @@ basic.forever(() => {
|
||||
|
||||
#### ~hint
|
||||
|
||||
This program does not work in the simulator, only in a micro:bit.
|
||||
This program does not work in the simulator, only in a @boardname@.
|
||||
|
||||
#### ~
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Temperature
|
||||
|
||||
Find the temperature where you are. The temperature is measured in Celsius (metric).
|
||||
The micro:bit can find the temperature nearby by checking how hot its computer chips are.
|
||||
The @boardname@ can find the temperature nearby by checking how hot its computer chips are.
|
||||
|
||||
```sig
|
||||
input.temperature();
|
||||
@@ -14,11 +14,11 @@ input.temperature();
|
||||
### How does it work?
|
||||
|
||||
The @boardname@ checks how hot its CPU (main computer chip) is.
|
||||
Because the micro:bit does not usually get very hot, the temperature of the CPU
|
||||
Because the @boardname@ 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!
|
||||
The @boardname@ might warm up a little if you make it work hard, though!
|
||||
|
||||
### Example: micro:bit thermometer
|
||||
### Example: @boardname@ thermometer
|
||||
|
||||
The following example uses `temperature` and `show number` to show the temperature of the room.
|
||||
|
||||
@@ -45,9 +45,9 @@ basic.forever(() => {
|
||||
|
||||
### ~hint
|
||||
|
||||
Try comparing the temperature your micro:bit shows to a real thermometer in the same place.
|
||||
You might be able to figure out how much to subtract from the number the micro:bit
|
||||
shows to get the real temperature. Then you can change your program so the micro:bit is a
|
||||
Try comparing the temperature your @boardname@ shows to a real thermometer in the same place.
|
||||
You might be able to figure out how much to subtract from the number the @boardname@
|
||||
shows to get the real temperature. Then you can change your program so the @boardname@ is a
|
||||
better thermometer.
|
||||
|
||||
### ~
|
||||
|
||||
@@ -20,9 +20,9 @@ led.plotBarGraph(2, 20);
|
||||
### Example: chart acceleration
|
||||
|
||||
This program shows a bar graph of the [acceleration](/reference/input/acceleration)
|
||||
in the `x` direction of the micro:bit.
|
||||
The micro:bit's `x` direction is from left to right (or right to left).
|
||||
The more you speed up moving the micro:bit in this direction,
|
||||
in the `x` direction of the @boardname@.
|
||||
The @boardname@'s `x` direction is from left to right (or right to left).
|
||||
The more you speed up moving the @boardname@ in this direction,
|
||||
the taller the lines in the bar graph will be,
|
||||
until they are as tall as the parameter `high` says they can be.
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ Returns the duration of a beat in milli-seconds
|
||||
|
||||
## Simulator
|
||||
|
||||
This function only works on the micro:bit and in some browsers.
|
||||
This function only works on the @boardname@ and in some browsers.
|
||||
|
||||
```sig
|
||||
music.beat(BeatFraction.Whole)
|
||||
|
||||
@@ -5,7 +5,7 @@ faster or slower by the amount you say.
|
||||
|
||||
## Simulator
|
||||
|
||||
This function only works on the micro:bit and in some browsers.
|
||||
This function only works on the @boardname@ and in some browsers.
|
||||
|
||||
```sig
|
||||
music.changeTempoBy(20)
|
||||
@@ -15,7 +15,7 @@ music.changeTempoBy(20)
|
||||
|
||||
* ``bpm`` is a [number](/reference/types/number) that says how much to
|
||||
change the bpm (beats per minute, or number of beats in a minute of
|
||||
the music that the micro:bit is playing).
|
||||
the music that the @boardname@ is playing).
|
||||
|
||||
### Examples
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
# Play Tone
|
||||
|
||||
Play a musical tone through pin ``P0`` of the micro:bit for as long as you say.
|
||||
Play a musical tone through pin ``P0`` of the @boardname@ for as long as you say.
|
||||
|
||||
## Simulator
|
||||
|
||||
This function only works on the micro:bit and in some browsers.
|
||||
This function only works on the @boardname@ and in some browsers.
|
||||
|
||||
```sig
|
||||
music.playTone(440, 120)
|
||||
|
||||
@@ -4,7 +4,7 @@ Rest (play no sound) through pin `PO` for the amount of time you say.
|
||||
|
||||
## Simulator
|
||||
|
||||
This function only works on the micro:bit and in some browsers.
|
||||
This function only works on the @boardname@ and in some browsers.
|
||||
|
||||
```sig
|
||||
music.rest(400)
|
||||
@@ -13,7 +13,7 @@ music.rest(400)
|
||||
### Parameters
|
||||
|
||||
* ``ms`` is a [number](/reference/types/number) saying how many
|
||||
milliseconds the micro:bit should rest. One second is 1000
|
||||
milliseconds the @boardname@ should rest. One second is 1000
|
||||
milliseconds.
|
||||
|
||||
## Example
|
||||
|
||||
@@ -5,7 +5,7 @@ The tone will keep playing until you tell it not to.
|
||||
|
||||
## Simulator
|
||||
|
||||
This function only works on the micro:bit and in some browsers.
|
||||
This function only works on the @boardname@ and in some browsers.
|
||||
|
||||
```sig
|
||||
music.ringTone(440)
|
||||
@@ -20,9 +20,9 @@ or pitch.
|
||||
|
||||
### Example
|
||||
|
||||
This program checks the **accelerometer** for the micro:bit's
|
||||
**acceleration** (how much the micro:bit is speeding up or slowing
|
||||
down). Then it uses that acceleration to make a tone. If the micro:bit
|
||||
This program checks the **accelerometer** for the @boardname@'s
|
||||
**acceleration** (how much the @boardname@ is speeding up or slowing
|
||||
down). Then it uses that acceleration to make a tone. If the @boardname@
|
||||
speeds up, the tone's pitch gets higher, and if it slows down, the
|
||||
tone's pitch gets lower. It's fun -- try it!
|
||||
|
||||
|
||||
@@ -7,11 +7,11 @@ music.setTempo(60)
|
||||
```
|
||||
## Simulator
|
||||
|
||||
This function only works on the micro:bit and in some browsers.
|
||||
This function only works on the @boardname@ and in some browsers.
|
||||
|
||||
### Parameters
|
||||
|
||||
* ``bpm`` is a [number](/reference/types/number) that means the beats per minute you want (the number of beats in a minute of the music that the micro:bit is playing).
|
||||
* ``bpm`` is a [number](/reference/types/number) that means the beats per minute you want (the number of beats in a minute of the music that the @boardname@ is playing).
|
||||
|
||||
### See also
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ music.tempo()
|
||||
### Returns
|
||||
|
||||
* a [number](/reference/types/number) that means the beats per minute (number of
|
||||
beats in a minute of the music that the micro:bit is playing).
|
||||
beats in a minute of the music that the @boardname@ is playing).
|
||||
|
||||
### See also
|
||||
|
||||
|
||||
@@ -27,5 +27,5 @@ pins.analogPitch(frequency1, duration)
|
||||
|
||||
### See also
|
||||
|
||||
[micro:bit pins](/device/pins), [analog set period](/reference/pins/analog-set-period), [analog set pitch pin](/reference/pins/analog-set-pitch-pin)
|
||||
[@boardname@ pins](/device/pins), [analog set period](/reference/pins/analog-set-period), [analog set pitch pin](/reference/pins/analog-set-pitch-pin)
|
||||
|
||||
|
||||
@@ -28,13 +28,13 @@ basic.forever(() => {
|
||||
|
||||
#### ~hint
|
||||
|
||||
If you are using **analog read pin** with another micro:bit running **analog write pin**, then things can get tricky. Remember that the micro:bit that runs **analog set pin** writes 0's and 1's at a very high frequency to achieve an average of the desired value. Sadly, if you try to read that average from another micro:bit, then the micro:bit will either read 0 or 1023. You could try to read a higher number of values (e.g. a million) in a loop, then computer then average. Alternatively, you can plug in a capacitor in-between the two micro:bits.
|
||||
If you are using **analog read pin** with another @boardname@ running **analog write pin**, then things can get tricky. Remember that the @boardname@ that runs **analog set pin** writes 0's and 1's at a very high frequency to achieve an average of the desired value. Sadly, if you try to read that average from another @boardname@, then the @boardname@ will either read 0 or 1023. You could try to read a higher number of values (e.g. a million) in a loop, then computer then average. Alternatively, you can plug in a capacitor in-between the two @boardname@s.
|
||||
|
||||
#### ~
|
||||
|
||||
### See also
|
||||
|
||||
[micro:bit pins](/device/pins),
|
||||
[@boardname@ pins](/device/pins),
|
||||
[on pin pressed](/reference/input/on-pin-pressed),
|
||||
[analog write pin](/reference/pins/analog-write-pin),
|
||||
[digital read pin](/reference/pins/digital-read-pin),
|
||||
|
||||
@@ -23,7 +23,7 @@ pins.analogSetPeriod(AnalogPin.P0, 20000)
|
||||
|
||||
### See also
|
||||
|
||||
[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),
|
||||
[analog write pin](/reference/pins/analog-write-pin),
|
||||
|
||||
@@ -26,5 +26,5 @@ pins.analogPitch(frequency, duration)
|
||||
|
||||
### See also
|
||||
|
||||
[micro:bit pins](/device/pins), [analog set period](/reference/pins/analog-set-period), [analog pitch](/reference/pins/analog-pitch)
|
||||
[@boardname@ pins](/device/pins), [analog set period](/reference/pins/analog-set-period), [analog pitch](/reference/pins/analog-pitch)
|
||||
|
||||
|
||||
@@ -30,5 +30,5 @@ and their average is `256`.
|
||||
|
||||
### See also
|
||||
|
||||
[micro:bit 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), [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), [digital read pin](/reference/pins/digital-read-pin), [digital write pin](/reference/pins/digital-write-pin)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Digital Read Pin
|
||||
|
||||
Read a **digital** (`0` or `1`) signal from a [pin](/device/pins) on
|
||||
the micro:bit board.
|
||||
the @boardname@ board.
|
||||
|
||||
```sig
|
||||
pins.digitalReadPin(DigitalPin.P3)
|
||||
@@ -43,9 +43,9 @@ basic.forever(() => {
|
||||
```
|
||||
|
||||
This program is a remote control for the score keeper program. If you
|
||||
connect `P1` on the remote control micro:bit to `P0` on the score
|
||||
keeper micro:bit, you can press button `B` on the remote to buzz and
|
||||
make the score bigger on the other micro:bit.
|
||||
connect `P1` on the remote control @boardname@ to `P0` on the score
|
||||
keeper @boardname@, you can press button `B` on the remote to buzz and
|
||||
make the score bigger on the other @boardname@.
|
||||
|
||||
```blocks
|
||||
input.onButtonPressed(Button.B, () => {
|
||||
@@ -56,13 +56,13 @@ input.onButtonPressed(Button.B, () => {
|
||||
```
|
||||
#### ~hint
|
||||
|
||||
Remember to connect `GND` on both micro:bits together!
|
||||
Remember to connect `GND` on both @boardname@s together!
|
||||
|
||||
#### ~
|
||||
|
||||
### See also
|
||||
|
||||
[micro:bit pins](/device/pins),
|
||||
[@boardname@ pins](/device/pins),
|
||||
[digital write pin](/reference/pins/digital-write-pin),
|
||||
[analog read pin](/reference/pins/analog-read-pin),
|
||||
[analog write pin](/reference/pins/analog-write-pin),
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Digital Write Pin
|
||||
|
||||
Write a **digital** (`0` or `1`) signal to a [pin](/device/pins) on
|
||||
the micro:bit board.
|
||||
the @boardname@ board.
|
||||
|
||||
```sig
|
||||
pins.digitalWritePin(DigitalPin.P1, 1)
|
||||
@@ -40,9 +40,9 @@ basic.forever(() => {
|
||||
```
|
||||
|
||||
This program is a remote control for the score keeper program. If you
|
||||
connect `P1` on the remote control micro:bit to `P0` on the score
|
||||
keeper micro:bit, you can press button `B` on the remote. This program
|
||||
will use ``digital write pin`` to make the other micro:bit buzz and
|
||||
connect `P1` on the remote control @boardname@ to `P0` on the score
|
||||
keeper @boardname@, you can press button `B` on the remote. This program
|
||||
will use ``digital write pin`` to make the other @boardname@ buzz and
|
||||
make the score bigger.
|
||||
|
||||
```blocks
|
||||
@@ -55,7 +55,7 @@ input.onButtonPressed(Button.B, () => {
|
||||
|
||||
### See also
|
||||
|
||||
[micro:bit pins](/device/pins),
|
||||
[@boardname@ pins](/device/pins),
|
||||
[digital read pin](/reference/pins/digital-read-pin),
|
||||
[analog read pin](/reference/pins/analog-read-pin),
|
||||
[analog write pin](/reference/pins/analog-write-pin),
|
||||
|
||||
@@ -10,7 +10,7 @@ pins.onPulsed(DigitalPin.P0, PulseValue.High, () => { });
|
||||
|
||||
### Parameters
|
||||
|
||||
* ``name``: The micro:bit hardware pin to configure (``P0`` through ``P20``)
|
||||
* ``name``: The @boardname@ hardware pin to configure (``P0`` through ``P20``)
|
||||
* ``pulse``: Which state will cause the associated block to execute (**High** or **Low**)
|
||||
|
||||
### Example
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Pulse In
|
||||
|
||||
Returns the duration of a pulse (high or low) from a [pin](/device/pins) on
|
||||
the micro:bit board in microseconds.
|
||||
the @boardname@ board in microseconds.
|
||||
|
||||
```sig
|
||||
pins.pulseIn(DigitalPin.P0, PulseValue.High)
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
|
||||
Configure the electrical pull of the specified pin.
|
||||
|
||||
Many micro:bit pins can be configured as _pull-ups_. For example, a
|
||||
Many @boardname@ pins can be configured as _pull-ups_. For example, a
|
||||
pull-up can set a pin's voltage to high (3.3 volts, or `1` when
|
||||
calling [digital read pin](/reference/pins/digital-read-pin)). If one
|
||||
end of a button is connected to ``P0`` (set to high) and the other end
|
||||
is connected to ``GND`` (0 volts), then when you press the button,
|
||||
``P0`` is driven to 0 volts, and the micro:bit software can detect a
|
||||
``P0`` is driven to 0 volts, and the @boardname@ software can detect a
|
||||
button press.
|
||||
|
||||
```sig
|
||||
@@ -16,7 +16,7 @@ pins.setPull(DigitalPin.P9, PinPullMode.PullDown);
|
||||
|
||||
### Parameters
|
||||
|
||||
* ``name``: The micro:bit hardware pin to configure (``P0``-``P20``)
|
||||
* ``name``: The @boardname@ hardware pin to configure (``P0``-``P20``)
|
||||
* ``pull``: The pull to which to set the pin (**down**, **up**, or **none**)
|
||||
|
||||
### Example
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# On Data Packet Received
|
||||
|
||||
Run part of a program when the micro:bit receives a
|
||||
Run part of a program when the @boardname@ receives a
|
||||
[number](/reference/types/number) or [string](/reference/types/string) over ``radio``.
|
||||
|
||||
|
||||
@@ -19,15 +19,15 @@ To add or remove the parts of the packet from the block, try clicking the blue g
|
||||
* ``packet`` - the [packet](/reference/radio/packet) that was received by the radio. The packet has the following properties:
|
||||
* `receivedNumber` - The [number](/reference/types/number) that was sent in this packet or `0` if this packet did not contain a number. See [send number](/reference/radio/send-number) and [send value](/reference/radio/send-value)
|
||||
* `receivedString` - The [string](/reference/types/string) that was sent in this packet or the empty string if this packet did not contain a string. See [send string](/reference/radio/send-string) and [send value](/reference/radio/send-value)
|
||||
* `time` - The system time of the micro:bit that sent this packet at the time the packet was sent.
|
||||
* `serial` - The serial number of the micro:bit that sent this packet or `0` if the micro:bit did not include its serial number.
|
||||
* `time` - The system time of the @boardname@ that sent this packet at the time the packet was sent.
|
||||
* `serial` - The serial number of the @boardname@ that sent this packet or `0` if the @boardname@ did not include its serial number.
|
||||
* `signal` - How strong the radio signal is from `255` (weak) to `0` (strong).
|
||||
|
||||
### Example
|
||||
|
||||
This program keeps sending numbers that says how fast the micro:bit is
|
||||
This program keeps sending numbers that says how fast the @boardname@ is
|
||||
slowing down or speeding up. It also receives numbers for the same
|
||||
thing from nearby micro:bits. It shows these numbers as a
|
||||
thing from nearby @boardname@s. It shows these numbers as a
|
||||
[bar graph](/reference/led/plot-bar-graph).
|
||||
|
||||
```blocks
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
> Note: This API has been deprecated! Use [on data packet received](/reference/radio/on-data-packet-received) instead.
|
||||
|
||||
Run part of a program when the micro:bit receives a
|
||||
Run part of a program when the @boardname@ receives a
|
||||
[number](/reference/types/number) or [string](/reference/types/string) over ``radio``.
|
||||
|
||||
|
||||
@@ -12,9 +12,9 @@ radio.onDataReceived(() => { });
|
||||
|
||||
### Example
|
||||
|
||||
This program keeps sending numbers that says how fast the micro:bit is
|
||||
This program keeps sending numbers that says how fast the @boardname@ is
|
||||
slowing down or speeding up. It also receives numbers for the same
|
||||
thing from nearby micro:bits. It shows these numbers as a
|
||||
thing from nearby @boardname@s. It shows these numbers as a
|
||||
[bar graph](/reference/led/plot-bar-graph).
|
||||
|
||||
```blocks
|
||||
|
||||
@@ -6,8 +6,8 @@ A packet that was received by the radio.
|
||||
|
||||
* `receivedNumber` - The [number](/reference/types/number) that was sent in this packet or `0` if this packet did not contain a number. See [send number](/reference/radio/send-number) and [send value](/reference/radio/send-value)
|
||||
* `receivedString` - The [string](/reference/types/string) that was sent in this packet or the empty string if this packet did not contain a string. See [send string](/reference/radio/send-string) and [send value](/reference/radio/send-value)
|
||||
* `time` - The system time of the micro:bit that sent this packet at the time the packet was sent.
|
||||
* `serial` - The serial number of the micro:bit that sent this packet or `0` if the micro:bit did not include its serial number.
|
||||
* `time` - The system time of the @boardname@ that sent this packet at the time the packet was sent.
|
||||
* `serial` - The serial number of the @boardname@ that sent this packet or `0` if the @boardname@ did not include its serial number.
|
||||
* `signal` - How strong the radio signal is from `255` (weak) to `0` (strong).
|
||||
|
||||
### See also
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
> Note: This API has been deprecated! Use [on data packet received](/reference/radio/on-data-packet-received) instead.
|
||||
|
||||
Receives the next number sent by a micro:bit in the same ``radio`` group.
|
||||
Receives the next number sent by a @boardname@ in the same ``radio`` group.
|
||||
|
||||
```sig
|
||||
radio.receiveNumber();
|
||||
@@ -10,11 +10,11 @@ radio.receiveNumber();
|
||||
|
||||
### Returns
|
||||
|
||||
* the first [number](/reference/types/number) that the micro:bit received. If it did not receive any numbers, this function will return `0`.
|
||||
* the first [number](/reference/types/number) that the @boardname@ received. If it did not receive any numbers, this function will return `0`.
|
||||
|
||||
### Example: Simple number receiver
|
||||
|
||||
This example receives the number broadcasted another micro:bit and shows it
|
||||
This example receives the number broadcasted another @boardname@ and shows it
|
||||
as a bar graph.
|
||||
|
||||
```blocks
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
> Note: This API has been deprecated! Use [on data packet received](/reference/radio/on-data-packet-received) instead.
|
||||
|
||||
Find the next string sent by `radio` from another micro:bit.
|
||||
Find the next string sent by `radio` from another @boardname@.
|
||||
|
||||
```sig
|
||||
radio.receiveString()
|
||||
@@ -15,7 +15,7 @@ radio.receiveString()
|
||||
|
||||
### Example: Simple receiver
|
||||
|
||||
Show the string sent by another micro:bit.
|
||||
Show the string sent by another @boardname@.
|
||||
|
||||
```blocks
|
||||
radio.onDataReceived(() => {
|
||||
@@ -25,8 +25,8 @@ radio.onDataReceived(() => {
|
||||
|
||||
### Example: Two-way radio
|
||||
|
||||
If you load this program onto two or more micro:bits, you can send a code word from one of them to the others by pressing button `A`.
|
||||
The other micro:bits will receive the code word and then show it.
|
||||
If you load this program onto two or more @boardname@s, you can send a code word from one of them to the others by pressing button `A`.
|
||||
The other @boardname@s will receive the code word and then show it.
|
||||
|
||||
```blocks
|
||||
input.onButtonPressed(Button.A, () => {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
Find how strong the ``radio`` signal is, from `255` to `0`.
|
||||
(`255` means a weak signal and `0` means a strong one.)
|
||||
|
||||
The micro:bit finds the signal strength by checking how strong it was
|
||||
The @boardname@ finds the signal strength by checking how strong it was
|
||||
the last time it ran the
|
||||
[on data packet received](/reference/radio/on-data-packet-received) function. That means
|
||||
it needs to run **receive number** first.
|
||||
@@ -21,7 +21,7 @@ how strong the signal is.
|
||||
|
||||
### Simulator
|
||||
|
||||
This function only works on the micro:bit, not in browsers.
|
||||
This function only works on the @boardname@, not in browsers.
|
||||
|
||||
### Example
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Send Number
|
||||
|
||||
Broadcast a [number](/reference/types/number) to other micro:bits connected via ``radio``.
|
||||
Broadcast a [number](/reference/types/number) to other @boardname@s connected via ``radio``.
|
||||
|
||||
```sig
|
||||
radio.sendNumber(0);
|
||||
@@ -13,8 +13,8 @@ radio.sendNumber(0);
|
||||
|
||||
### Example: Broadcasting acceleration
|
||||
|
||||
This example broadcasts the value of your micro:bit's ``acceleration``
|
||||
in the `x` direction (left and right) to other micro:bits. This kind
|
||||
This example broadcasts the value of your @boardname@'s ``acceleration``
|
||||
in the `x` direction (left and right) to other @boardname@s. This kind
|
||||
of program might be useful in a model car or model rocket.
|
||||
|
||||
```blocks
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Send String
|
||||
|
||||
Sends a string to other micro:bits in the area connected by radio. The
|
||||
Sends a string to other @boardname@s in the area connected by radio. The
|
||||
maximum string length is 19 characters.
|
||||
|
||||
```sig
|
||||
@@ -14,9 +14,9 @@ radio.sendString("Hello!")
|
||||
|
||||
### Example: Two-way radio
|
||||
|
||||
If you load this program onto two or more micro:bits, you can send a
|
||||
If you load this program onto two or more @boardname@s, you can send a
|
||||
code word from one of them to the others by pressing button `A`. The
|
||||
other micro:bits will receive the code word and then show it.
|
||||
other @boardname@s will receive the code word and then show it.
|
||||
|
||||
```blocks
|
||||
input.onButtonPressed(Button.A, () => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Send Value
|
||||
|
||||
Send a [string]() and [number]() together by ``radio`` to other micro:bits.
|
||||
Send a [string]() and [number]() together by ``radio`` to other @boardname@s.
|
||||
The maximum [string]() length is 12 characters.
|
||||
|
||||
```sig
|
||||
@@ -14,9 +14,9 @@ radio.sendValue("name", 0);
|
||||
|
||||
### Example: Broadcasting acceleration
|
||||
|
||||
This program sends your micro:bit's **acceleration** (amount it is
|
||||
This program sends your @boardname@'s **acceleration** (amount it is
|
||||
speeding up or slowing down) in the `x` direction (left and right) to
|
||||
other micro:bits. This kind of program might be useful in a model car
|
||||
other @boardname@s. This kind of program might be useful in a model car
|
||||
or model rocket.
|
||||
|
||||
```blocks
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
# Set Group
|
||||
|
||||
Make a program have the group ID you tell it for sending and receiving
|
||||
with ``radio``. A group is like a cable channel (a micro:bit can only
|
||||
with ``radio``. A group is like a cable channel (a @boardname@ can only
|
||||
send or receive in one group at a time). A group ID is like the cable
|
||||
channel number.
|
||||
|
||||
If you do not tell your program which group ID to use with this
|
||||
function, it will figure out its own group ID by itself. If you load
|
||||
the very same program onto two different micro:bits, they will be able
|
||||
the very same program onto two different @boardname@s, they will be able
|
||||
to talk to each other because they will have the same group ID.
|
||||
|
||||
```sig
|
||||
@@ -20,7 +20,7 @@ radio.setGroup(0);
|
||||
|
||||
### Simulator
|
||||
|
||||
This function only works on the micro:bit, not in browsers.
|
||||
This function only works on the @boardname@, not in browsers.
|
||||
|
||||
### Example
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Set Transmit Power
|
||||
|
||||
Make the ``radio`` signal of the micro:bit stronger or weaker.
|
||||
Make the ``radio`` signal of the @boardname@ stronger or weaker.
|
||||
It can be as weak as `0` and as strong as `7`.
|
||||
|
||||
The scientific name for the strength of the ``radio`` signal is
|
||||
@@ -14,8 +14,8 @@ radio.setTransmitPower(7);
|
||||
|
||||
### Range
|
||||
|
||||
If your micro:bit is sending with a strength of `7`, and you are in
|
||||
an open area without many other computers around, the micro:bit signal
|
||||
If your @boardname@ is sending with a strength of `7`, and you are in
|
||||
an open area without many other computers around, the @boardname@ signal
|
||||
can reach as far as 70 meters (about 230 feet).
|
||||
|
||||
### Parameters
|
||||
@@ -25,7 +25,7 @@ means how strong the signal is.
|
||||
|
||||
### Simulator
|
||||
|
||||
This function only works on the micro:bit, not in browsers.
|
||||
This function only works on the @boardname@, not in browsers.
|
||||
|
||||
### Example
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ The format for received data printed to serial is as follows:
|
||||
### Examples
|
||||
|
||||
When ```radio``` data is received (after pressing the ``A`` button on
|
||||
the second micro:bit), this program sends temperature data to
|
||||
the second @boardname@), this program sends temperature data to
|
||||
serial.
|
||||
|
||||
```blocks
|
||||
|
||||
@@ -19,7 +19,7 @@ The format for received data printed to serial is as follows:
|
||||
### Examples
|
||||
|
||||
When ```radio``` data is received (after pressing the ``A`` button on
|
||||
the second micro:bit), this program sends temperature data to
|
||||
the second @boardname@), this program sends temperature data to
|
||||
serial.
|
||||
|
||||
```blocks
|
||||
|
||||
@@ -30,7 +30,7 @@ basic.forever(() => {
|
||||
#### ~hint
|
||||
|
||||
The [send value](/reference/radio/send-value) function broadcasts
|
||||
string/number pairs. You can use a second micro:bit to receive them,
|
||||
string/number pairs. You can use a second @boardname@ to receive them,
|
||||
and then send them directly to the serial port with ``write value``.
|
||||
|
||||
#### ~
|
||||
|
||||
@@ -6,6 +6,6 @@ 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)
|
||||
* **[Boolean](/blocks/logic/boolean)**: true or false
|
||||
* **[Image](/reference/images/image)**: a collection of [micro:bit LED states](/device/screen) (on/off)
|
||||
* **[Image](/reference/images/image)**: a collection of [@boardname@ LED states](/device/screen) (on/off)
|
||||
|
||||
TypeScript allows you to create user-defined classes of data.
|
||||
|
||||
@@ -31,7 +31,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:
|
||||
If the string is multiple characters, the string scrolls right to left. The following example displays `Hello world!` on the @boardname@ screen:
|
||||
|
||||
```block
|
||||
basic.showString("Hello world!");
|
||||
|
||||
Reference in New Issue
Block a user