be7858cbed
* Fix example and do a few edits (#850) * Small fixes to the Karel project text (#862) * fix missing shadow type * add calibration info (#897) microbit-support:6348 User reported bug, but didn't realie micro:bit compass had to be calibrated on first run of the program. * Cherry pick adding various cross-editor compat APIs (#863) * fix nudge * Fix a typo ("screent") in the documentation (#1012) * Fix a typo "screent" -> "the LED screen" * Update showArrow doc string for consistency with other methods * Doc bugs found by xlators (#899) * Update rotation.md (#998) reflects actual behaviour of the board * fixed layout corruption (#1073) * Updating the new bug filer with the right link * Update challenges.md (#1325) For what I'm taught in school, 2 follows 1 😉😉. * Update simulator.md (#1209) * Update plant watering.md (#1264) the connection to servo are male not female * support for MIDI simulator in v0 (#1331) * Doc improvements (#1337) * update grammar in radio-dashboard sample code * Chanllenge 2 follows 1 I open all challenges.md without "Challenge 2" and review the file `grep -r "Challenge 2" -L | grep challenge | xargs -I@ code @` Changes to be committed: modified: docs/lessons/counter/challenges.md modified: docs/lessons/game-counter/challenges.md modified: docs/lessons/night-light/challenges.md modified: docs/lessons/snowflake-fall/challenges.md * Revert "support for MIDI simulator in v0 (#1331)" This reverts commit 30a9c411fb80762656e7a636feff8e77b7fd9e67. * Revert "Cherry pick adding various cross-editor compat APIs (#863)" This reverts commit 7308dbef23e9ee402bebb7e721d7014d8252c9e5. * Fixed pin needed to replace button A (#1385) * Cherry pick part of the signature update in in2cWriteBuffer (#863): 7308dbe
43 lines
1.4 KiB
Markdown
43 lines
1.4 KiB
Markdown
# Advertise Url
|
|
|
|
Advertises a URL via the Eddystone protocol over Bluetooth.
|
|
|
|
## ~hint
|
|
|
|
## Eddystone
|
|
|
|
Bluetooth beacons are used to indicate proximity to a place or object of interest.
|
|
Beacons use Bluetooth advertising to broadcast a small amount of data,
|
|
which can be received and acted upon by anyone in range with a suitable device and software, typically a smartphone and application.
|
|
|
|
There are various beacon message formats, which define the way Bluetooth advertising packets are used as containers for beacon data.
|
|
iBeacon is Apple's beacon message format. Eddystone comes from Google.
|
|
|
|
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.
|
|
* ``power`` - a [number](/types/number) representing the power level between 0 (short) and 7 (maximum range).
|
|
* ``connectable`` - a [boolean](/blocks/logic/boolean) indicating whether or not the @boardname@ should accept connections.
|
|
|
|
## Example: Broadcast a secret code
|
|
|
|
```blocks
|
|
bluetooth.advertiseUrl("https://pxt.io?secret=42", 7, true);
|
|
```
|
|
|
|
## See Also
|
|
|
|
[stop-advertising](/reference/bluetooth/stop-advertising), [advertise-uid](/reference/bluetooth/advertise-uid)
|
|
|
|
```package
|
|
bluetooth
|
|
```
|