Fixing parameters
This commit is contained in:
		@@ -3,9 +3,10 @@
 | 
				
			|||||||
Run part of a program when the micro:bit receives a
 | 
					Run part of a program when the micro:bit receives a
 | 
				
			||||||
[number](/reference/types/number) or [string](/reference/types/string) over ``radio``.
 | 
					[number](/reference/types/number) or [string](/reference/types/string) over ``radio``.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
### Parameters
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
* the part of the program to run when the micro:bit receives information over ``radio``.
 | 
					```sig
 | 
				
			||||||
 | 
					radio.onDataReceived(() => { });
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
### Simulator
 | 
					### Simulator
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,6 +2,10 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
Receives the next number sent by a micro:bit in the same ``radio`` group.
 | 
					Receives the next number sent by a micro:bit in the same ``radio`` group.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```sig
 | 
				
			||||||
 | 
					radio.receiveNumber();
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
### Returns
 | 
					### 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 micro:bit received. If it did not receive any numbers, this function will return `0`.
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -8,7 +8,8 @@ radio.receiveString()
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
### Returns
 | 
					### Returns
 | 
				
			||||||
 | 
					
 | 
				
			||||||
* the first [string](/reference/types/string) that was sent. If no string was sent, then this function returns an empty (blank) string.
 | 
					* the first [string](/reference/types/string) that was sent. If no
 | 
				
			||||||
 | 
					  string was sent, then this function returns an empty (blank) string.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
### Simulator
 | 
					### Simulator
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -8,6 +8,10 @@ the last time it ran the
 | 
				
			|||||||
[receive number](/reference/radio/receive-number) function. That means
 | 
					[receive number](/reference/radio/receive-number) function. That means
 | 
				
			||||||
it needs to run **receive number** first.
 | 
					it needs to run **receive number** first.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```sig
 | 
				
			||||||
 | 
					radio.receivedSignalStrength();
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
### Returns
 | 
					### Returns
 | 
				
			||||||
 | 
					
 | 
				
			||||||
* a [number](/reference/types/number) between `255` and `0` that means
 | 
					* a [number](/reference/types/number) between `255` and `0` that means
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,10 +1,14 @@
 | 
				
			|||||||
# Send Number
 | 
					# Send Number
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Broadcast a number to other micro:bits connected via ``radio``.
 | 
					Broadcast a [number](/reference/types/number) to other micro:bits connected via ``radio``.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```sig
 | 
				
			||||||
 | 
					radio.sendNumber(0);
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
### Parameters
 | 
					### Parameters
 | 
				
			||||||
 | 
					
 | 
				
			||||||
* num - a number to send.
 | 
					* ``value`` - a [number](/reference/types/number) to send.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
### Simulator
 | 
					### Simulator
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -12,9 +16,9 @@ This function only works on the micro:bit, not in browsers.
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
### Example: Broadcasting acceleration
 | 
					### Example: Broadcasting acceleration
 | 
				
			||||||
 | 
					
 | 
				
			||||||
This example broadcasts the value of your micro:bit's ``acceleration`` in the `x` direction 
 | 
					This example broadcasts the value of your micro:bit's ``acceleration``
 | 
				
			||||||
(left and right) to other micro:bits.
 | 
					in the `x` direction (left and right) to other micro:bits.  This kind
 | 
				
			||||||
This kind of program might be useful in a model car or model rocket.
 | 
					of program might be useful in a model car or model rocket.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
```blocks
 | 
					```blocks
 | 
				
			||||||
input.onButtonPressed(Button.A, () => {
 | 
					input.onButtonPressed(Button.A, () => {
 | 
				
			||||||
@@ -39,4 +43,3 @@ basic.forever(() => {
 | 
				
			|||||||
### See also
 | 
					### See also
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[receive number](/reference/radio/receive-number), [on data received](/reference/radio/on-data-received)
 | 
					[receive number](/reference/radio/receive-number), [on data received](/reference/radio/on-data-received)
 | 
				
			||||||
 | 
					 | 
				
			||||||
 
 | 
				
			|||||||
@@ -8,18 +8,17 @@ radio.sendString("Hello!")
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
### Parameters
 | 
					### Parameters
 | 
				
			||||||
 | 
					
 | 
				
			||||||
* `text` is a [String](/reference/types/string) to send by radio.
 | 
					* `msg` is a [string](/reference/types/string) to send by radio.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
### Simulator
 | 
					### Simulator
 | 
				
			||||||
 | 
					
 | 
				
			||||||
This function only works on the micro:bit, not in browsers.
 | 
					This function only works on the micro:bit, not in browsers.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
### Example: Two-way radio
 | 
					### 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`.
 | 
					If you load this program onto two or more micro:bits, you can send a
 | 
				
			||||||
The other micro:bits will receive the code word and then show it.
 | 
					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.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
```blocks
 | 
					```blocks
 | 
				
			||||||
input.onButtonPressed(Button.A, () => {
 | 
					input.onButtonPressed(Button.A, () => {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,10 +2,14 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
Send a [string]() and [number]() together by ``radio`` to other micro:bits.
 | 
					Send a [string]() and [number]() together by ``radio`` to other micro:bits.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```sig
 | 
				
			||||||
 | 
					radio.sendValue("data", 0);
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
### Parameters
 | 
					### Parameters
 | 
				
			||||||
 | 
					
 | 
				
			||||||
* a [string](/reference/types/string) to send by radio
 | 
					* ``name`` is a [string](/reference/types/string) to send by radio
 | 
				
			||||||
* a [number](/reference/types/number) to send by radio
 | 
					* ``value`` a [number](/reference/types/number) to send by radio
 | 
				
			||||||
 | 
					
 | 
				
			||||||
### Simulator
 | 
					### Simulator
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -10,6 +10,10 @@ 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 micro:bits, they will be able
 | 
				
			||||||
to talk to each other because they will have the same group ID.
 | 
					to talk to each other because they will have the same group ID.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```sig
 | 
				
			||||||
 | 
					radio.setGroup(0);
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
### Parameters
 | 
					### Parameters
 | 
				
			||||||
 | 
					
 | 
				
			||||||
* ``id`` is a [number](/reference/types/number) from ``0`` to ``255``.
 | 
					* ``id`` is a [number](/reference/types/number) from ``0`` to ``255``.
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -8,6 +8,10 @@ The scientific name for the strength of the ``radio`` signal is
 | 
				
			|||||||
can be measured as -30 dBm, and a strength of `7` can be
 | 
					can be measured as -30 dBm, and a strength of `7` can be
 | 
				
			||||||
measured as +4 dBm.
 | 
					measured as +4 dBm.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```sig
 | 
				
			||||||
 | 
					radio.setTransmitPower(7);
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
### Range
 | 
					### Range
 | 
				
			||||||
   
 | 
					   
 | 
				
			||||||
If your micro:bit is sending with a strength of `7`, and you are in
 | 
					If your micro:bit is sending with a strength of `7`, and you are in
 | 
				
			||||||
@@ -16,7 +20,7 @@ can reach as far as 70 meters (about 230 feet).
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
### Parameters
 | 
					### Parameters
 | 
				
			||||||
 | 
					
 | 
				
			||||||
* a [number](/reference/types/number) between ``0`` and ``7`` that
 | 
					* ``power`` is a [number](/reference/types/number) between ``0`` and ``7`` that
 | 
				
			||||||
means how strong the signal is.
 | 
					means how strong the signal is.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
### Simulator
 | 
					### Simulator
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,16 +1,19 @@
 | 
				
			|||||||
# Write Value To Serial
 | 
					# Write Value To Serial
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Writes the full data received data  via ``radio`` to serial in JSON format.   
 | 
					Writes the full data received data  via ``radio`` to serial in JSON format.   
 | 
				
			||||||
 | 
					
 | 
				
			||||||
**Note** - This method only works for [send number](/reference/radio/send-number) and [send value](/reference/radio/send-value). It does not work for [send string](/reference/radio/send-string) (although a string can be sent with [send value](/reference/radio/send-value)).   
 | 
					**Note** - This method only works for [send number](/reference/radio/send-number) and [send value](/reference/radio/send-value). It does not work for [send string](/reference/radio/send-string) (although a string can be sent with [send value](/reference/radio/send-value)).   
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```sig
 | 
				
			||||||
 | 
					radio.writeValueToSerial();
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Data received format
 | 
					## Data received format
 | 
				
			||||||
The format for received data printed to serial is as follows    
 | 
					The format for received data printed to serial is as follows    
 | 
				
			||||||
- [send number](/reference/radio/send-number) - ```{v:ValueSent,t:MicrobitTimeAlive,s:Unused}```
 | 
					- [send number](/reference/radio/send-number) - ```{v:ValueSent,t:MicrobitTimeAlive,s:Unused}```
 | 
				
			||||||
- [send value](/reference/radio/send-number) - ```{v:Value,t:MicrobitTimeAlive,s:Unused,n:"Name"}```
 | 
					- [send value](/reference/radio/send-number) - ```{v:Value,t:MicrobitTimeAlive,s:Unused,n:"Name"}```
 | 
				
			||||||
- [send string](/reference/radio/send-string) - ```{}``` (currently unavailable)
 | 
					- [send string](/reference/radio/send-string) - ```{}``` (currently unavailable)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
### Simulator
 | 
					### Simulator
 | 
				
			||||||
 | 
					
 | 
				
			||||||
This function only works on the micro:bit, not in browsers.
 | 
					This function only works on the micro:bit, not in browsers.
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user