Updates for V4 (#197)
* update yotta defaults for 16kb devices * refactor deprecated blocks * updates for button events * update button events * update refference * update docs * update docs * update button event blocks * update docs * update block id
This commit is contained in:
@@ -2,6 +2,18 @@
|
||||
|
||||
Advertises a UID via the Eddystone protocol over Bluetooth.
|
||||
|
||||
```sig
|
||||
bluetooth.advertiseUidBuffer(pins.createBuffer(16), 7, true);
|
||||
```
|
||||
|
||||
### ~ reminder
|
||||
|
||||
#### Deprecated
|
||||
|
||||
This API is deprecated. The Eddystone beacon format is no longer supported, see [Google Beacon format (Deprecated)](https://developers.google.com/beacons/eddystone).
|
||||
|
||||
### ~
|
||||
|
||||
## ~hint
|
||||
|
||||
## Eddystone
|
||||
@@ -17,10 +29,6 @@ Read more at https://lancaster-university.github.io/microbit-docs/ble/eddystone/
|
||||
|
||||
## ~
|
||||
|
||||
```sig
|
||||
bluetooth.advertiseUidBuffer(pins.createBuffer(16), 7, true);
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
* ``buffer`` - a 16 bytes buffer containing the namespace (first 10 bytes) and instance (last 6 bytes).
|
||||
|
@@ -2,6 +2,18 @@
|
||||
|
||||
Advertises a UID via the Eddystone protocol over Bluetooth.
|
||||
|
||||
```sig
|
||||
bluetooth.advertiseUid(42, 1, 7, true);
|
||||
```
|
||||
|
||||
### ~ reminder
|
||||
|
||||
#### Deprecated
|
||||
|
||||
This API is deprecated. The Eddystone beacon format is no longer supported, see [Google Beacon format (Deprecated)](https://developers.google.com/beacons/eddystone).
|
||||
|
||||
### ~
|
||||
|
||||
## ~hint
|
||||
|
||||
## Eddystone
|
||||
@@ -17,10 +29,6 @@ Read more at https://lancaster-university.github.io/microbit-docs/ble/eddystone/
|
||||
|
||||
## ~
|
||||
|
||||
```sig
|
||||
bluetooth.advertiseUid(42, 1, 7, true);
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
* ``namespace`` last 4 bytes of the namespace uid (6 to 9)
|
||||
|
@@ -2,6 +2,18 @@
|
||||
|
||||
Advertises a URL via the Eddystone protocol over Bluetooth.
|
||||
|
||||
```sig
|
||||
bluetooth.advertiseUrl("https://makecode.microbit.org/", 7, true);
|
||||
```
|
||||
|
||||
### ~ reminder
|
||||
|
||||
#### Deprecated
|
||||
|
||||
This API is deprecated. The Eddystone beacon format is no longer supported, see [Google Beacon format (Deprecated)](https://developers.google.com/beacons/eddystone).
|
||||
|
||||
### ~
|
||||
|
||||
## ~hint
|
||||
|
||||
## Eddystone
|
||||
@@ -17,10 +29,6 @@ Read more at https://lancaster-university.github.io/microbit-docs/ble/eddystone/
|
||||
|
||||
## ~
|
||||
|
||||
```sig
|
||||
bluetooth.advertiseUrl("https://makecode.microbit.org/", 7, true);
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
* ``url`` - a [string](/types/string) containing the URL to broadcast, at most 17 characters long, excluding the protocol (eg: ``https://``) which gets encoded as 1 byte.
|
||||
|
@@ -1,21 +1,50 @@
|
||||
# Bluetooth On UART Data Received
|
||||
|
||||
Registers an event to be fired when one of the delimiter is matched.
|
||||
Runs some code in an event when a delimiter is matched in the received data.
|
||||
|
||||
```sig
|
||||
bluetooth.onUartDataReceived(",", () => {})
|
||||
bluetooth.onUartDataReceived(serial.delimiters(Delimiters.NewLine), function() {})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
* `delimiters` is a [string](/types/string) containing any of the character to match
|
||||
* **delimiters**: a [string](/types/string) containing the delimiter characters to match in the received data.
|
||||
|
||||
### ~ hint
|
||||
|
||||
#### Delimiters
|
||||
|
||||
Delimiters are characters in a received data string which divide the string into smaller strings to form separate data items.
|
||||
|
||||
Although multiple delimiter characters can be set in the **delimiters** string, it is common to have received data separated using just one delimiter character, such as a comma:
|
||||
|
||||
``"data1,data2,data3,data4"``
|
||||
|
||||
So, you can specify a delimiter character using the ``||serial:serial delimiters||`` which create a single character delimiter string for you...
|
||||
|
||||
```block
|
||||
bluetooth.onUartDataReceived(serial.delimiters(Delimiters.Comma), function () {
|
||||
})
|
||||
```
|
||||
Or, maybe...
|
||||
|
||||
```block
|
||||
let delim = serial.delimiters(Delimiters.NewLine)
|
||||
basic.showString(bluetooth.uartReadUntil(delim))
|
||||
```
|
||||
|
||||
### ~
|
||||
|
||||
## Example
|
||||
|
||||
Read values separated by `,`:
|
||||
Read the data items separated by a comma (`,`):
|
||||
|
||||
```blocks
|
||||
bluetooth.onUartDataReceived(serial.delimiters(Delimiters.Comma), () => {
|
||||
basic.showString(serial.readUntil(serial.delimiters(Delimiters.Comma)))
|
||||
bluetooth.onUartDataReceived(serial.delimiters(Delimiters.Comma), function () {
|
||||
basic.showString(bluetooth.uartReadUntil(serial.delimiters(Delimiters.Space)))
|
||||
})
|
||||
```
|
||||
|
||||
```package
|
||||
bluetooth
|
||||
```
|
||||
|
Reference in New Issue
Block a user