From 3049c88d5b0e632bb4ac2e32ee3c4d07fb6738b7 Mon Sep 17 00:00:00 2001 From: Ron Hale-Evans Date: Thu, 9 Jun 2016 15:30:47 -0700 Subject: [PATCH] Simulator warnings, etc. --- docs/reference/radio/on-data-received.md | 4 ++++ docs/reference/radio/receive-number.md | 6 +++++- docs/reference/radio/receive-string.md | 6 +++++- docs/reference/radio/received-signal-strength.md | 2 +- docs/reference/radio/send-number.md | 4 ++++ docs/reference/radio/send-string.md | 8 ++++++-- docs/reference/radio/set-group.md | 4 ++++ docs/reference/radio/set-transmit-power.md | 6 +++++- docs/reference/radio/write-value-to-serial.md | 14 ++------------ 9 files changed, 36 insertions(+), 18 deletions(-) diff --git a/docs/reference/radio/on-data-received.md b/docs/reference/radio/on-data-received.md index 288817bd..56da6042 100644 --- a/docs/reference/radio/on-data-received.md +++ b/docs/reference/radio/on-data-received.md @@ -7,6 +7,10 @@ Run part of a program when the micro:bit receives a * the part of the program to run when the micro:bit receives information over ``radio``. +### Simulator + +This function only works on the micro:bit, not in browsers. + ### Example This program keeps sending numbers that says how fast the micro:bit is diff --git a/docs/reference/radio/receive-number.md b/docs/reference/radio/receive-number.md index 8b25e601..532e6145 100644 --- a/docs/reference/radio/receive-number.md +++ b/docs/reference/radio/receive-number.md @@ -2,10 +2,14 @@ Receives the next number sent by a micro:bit in the same ``radio`` group. -### Return value +### Returns * the first [number](/reference/types/number) that the micro:bit received. If it did not receive any numbers, this function will return `0`. +### Simulator + +This function only works on the micro:bit, not in browsers. + ### Example: Simple number receiver This example receives the number broadcasted another micro:bit and shows it diff --git a/docs/reference/radio/receive-string.md b/docs/reference/radio/receive-string.md index f28765e9..822338c7 100644 --- a/docs/reference/radio/receive-string.md +++ b/docs/reference/radio/receive-string.md @@ -6,10 +6,14 @@ Find the next string sent by `radio` from another micro:bit. radio.receiveString() ``` -### Return value +### Returns * the first [string](/reference/types/string) that was sent. If no string was sent, then this function returns an empty (blank) string. +### Simulator + +This function only works on the micro:bit, not in browsers. + ### Example: Simple receiver Show the string sent by another micro:bit. diff --git a/docs/reference/radio/received-signal-strength.md b/docs/reference/radio/received-signal-strength.md index d4d483e8..e5ab2b0d 100644 --- a/docs/reference/radio/received-signal-strength.md +++ b/docs/reference/radio/received-signal-strength.md @@ -13,7 +13,7 @@ it needs to run **receive number** first. * a [number](/reference/types/number) between `255` and `0` that means how strong the signal is. -## Simulator +### Simulator This function only works on the micro:bit, not in browsers. diff --git a/docs/reference/radio/send-number.md b/docs/reference/radio/send-number.md index 45f70cf5..ce79122e 100644 --- a/docs/reference/radio/send-number.md +++ b/docs/reference/radio/send-number.md @@ -6,6 +6,10 @@ Broadcast a number to other micro:bits connected via ``radio``. * num - a number to send. +### Simulator + +This function only works on the micro:bit, not in browsers. + ### Example: Broadcasting acceleration This example broadcasts the value of your micro:bit's ``acceleration`` in the `x` direction diff --git a/docs/reference/radio/send-string.md b/docs/reference/radio/send-string.md index 13320767..8725fa72 100644 --- a/docs/reference/radio/send-string.md +++ b/docs/reference/radio/send-string.md @@ -1,7 +1,5 @@ # Send String - - Sends a string to other micro:bits in the area connected by radio. ```sig @@ -12,6 +10,12 @@ radio.sendString("Hello!") * `text` is a [String](/reference/types/string) to send by radio. +### Simulator + +This function only works on the micro:bit, not in browsers. + + + ### 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`. diff --git a/docs/reference/radio/set-group.md b/docs/reference/radio/set-group.md index a76de54d..9ce88acf 100644 --- a/docs/reference/radio/set-group.md +++ b/docs/reference/radio/set-group.md @@ -14,6 +14,10 @@ to talk to each other because they will have the same group ID. * ``id`` is a [number](/reference/types/number) from ``0`` to ``255``. +### Simulator + +This function only works on the micro:bit, not in browsers. + ### Example This program makes the group ID equal 128. diff --git a/docs/reference/radio/set-transmit-power.md b/docs/reference/radio/set-transmit-power.md index e5efb1ff..941f1359 100644 --- a/docs/reference/radio/set-transmit-power.md +++ b/docs/reference/radio/set-transmit-power.md @@ -8,7 +8,7 @@ The scientific name for the strength of the ``radio`` signal is can be measured as -30 dBm, and a strength of `7` can be measured as +4 dBm. -## Range +### 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 @@ -19,6 +19,10 @@ can reach as far as 70 meters (about 230 feet). * a [number](/reference/types/number) between ``0`` and ``7`` that means how strong the signal is. +### Simulator + +This function only works on the micro:bit, not in browsers. + ### Example This program makes the ``radio`` send at full strength. diff --git a/docs/reference/radio/write-value-to-serial.md b/docs/reference/radio/write-value-to-serial.md index a618b2b7..8abbcd61 100644 --- a/docs/reference/radio/write-value-to-serial.md +++ b/docs/reference/radio/write-value-to-serial.md @@ -9,21 +9,11 @@ The format for received data printed to serial is as follows - [send value](/reference/radio/send-number) - ```{v:Value,t:MicrobitTimeAlive,s:Unused,n:"Name"}``` - [send string](/reference/radio/send-string) - ```{}``` (currently unavailable) -## Important Security Consideration -The functions in the ``radio`` namespace allow the BBC micro:bit to communicate with other micro:bits. -This API does not contain any form of encryption, authentication or authorization. It's purpose is solely for use as a teaching aid to demonstrate how simple communications operates, and to provide a sandpit through which learning can take place. +### Simulator -For serious applications, BLE should be considered a substantially more secure alternative. - -```sig -radio.writeValueToSerial() -``` - -### Parameters - -* None +This function only works on the micro:bit, not in browsers. ### Examples