Compare commits
11 Commits
Author | SHA1 | Date | |
---|---|---|---|
edfbc4da18 | |||
3a1c6a6ce3 | |||
9a4a2264fa | |||
e9558ce158 | |||
50677fadc4 | |||
649e8f7c0f | |||
0cb9c28f8d | |||
004d9b4315 | |||
7a5b3aba01 | |||
dc30263642 | |||
619658a057 |
@ -21,7 +21,7 @@ To add or remove the parts of the packet from the block, try clicking the blue g
|
||||
* `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 @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).
|
||||
* `signal` - How strong the radio signal is from `-128` (weak) to `-42` (strong).
|
||||
|
||||
### Example
|
||||
|
||||
@ -39,6 +39,23 @@ radio.onDataPacketReceived(({ receivedNumber }) => {
|
||||
})
|
||||
```
|
||||
|
||||
### Example
|
||||
|
||||
This program uses the signal strength from received packets to graph the
|
||||
approximate distance between two @boardname@s.
|
||||
|
||||
```blocks
|
||||
basic.forever(() => {
|
||||
radio.sendNumber(0)
|
||||
})
|
||||
radio.onDataPacketReceived(({ signal, receivedNumber }) => {
|
||||
led.plotBarGraph(
|
||||
Math.abs(signal + 42),
|
||||
128 - 42
|
||||
)
|
||||
})
|
||||
```
|
||||
|
||||
### See also
|
||||
|
||||
[send number](/reference/radio/send-number),
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
> Note: This API has been deprecated! Use [on data packet received](/reference/radio/on-data-packet-received) instead.
|
||||
|
||||
Find how strong the ``radio`` signal is, from `255` to `0`.
|
||||
(`255` means a weak signal and `0` means a strong one.)
|
||||
Find how strong the ``radio`` signal is, from `-128` to `-42`.
|
||||
(`-128` means a weak signal and `-42` means a strong one.)
|
||||
|
||||
The @boardname@ finds the signal strength by checking how strong it was
|
||||
the last time it ran the
|
||||
@ -16,7 +16,7 @@ radio.receivedSignalStrength();
|
||||
|
||||
### Returns
|
||||
|
||||
* a [number](/reference/types/number) between `255` and `0` that means
|
||||
* a [number](/reference/types/number) between `-128` and `-42` that means
|
||||
how strong the signal is.
|
||||
|
||||
### Simulator
|
||||
|
3
docs/static/logo.square.black.svg
vendored
3
docs/static/logo.square.black.svg
vendored
@ -11,8 +11,7 @@
|
||||
aria-labelledby="title desc"
|
||||
xml:space="preserve"
|
||||
enable-background="new 0 0 280 32.755"
|
||||
height="52.672001"
|
||||
width="52.672001"
|
||||
viewBox="0 0 52.672001 52.672001"
|
||||
version="1.1"
|
||||
id="svg2"
|
||||
inkscape:version="0.91 r13725"
|
||||
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
3
docs/static/logo.square.white.svg
vendored
3
docs/static/logo.square.white.svg
vendored
@ -11,8 +11,7 @@
|
||||
aria-labelledby="title desc"
|
||||
xml:space="preserve"
|
||||
enable-background="new 0 0 280 32.755"
|
||||
height="52.672001"
|
||||
width="52.672001"
|
||||
viewBox="0 0 52.672001 52.672001"
|
||||
version="1.1"
|
||||
id="svg2"
|
||||
inkscape:version="0.91 r13725"
|
||||
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "pxt-microbit",
|
||||
"version": "0.7.43",
|
||||
"version": "0.7.45",
|
||||
"description": "micro:bit target for PXT",
|
||||
"keywords": [
|
||||
"JavaScript",
|
||||
@ -36,6 +36,6 @@
|
||||
"semantic-ui-less": "^2.2.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"pxt-core": "0.10.14"
|
||||
"pxt-core": "0.11.1"
|
||||
}
|
||||
}
|
||||
|
@ -330,6 +330,7 @@
|
||||
"invertedMenu": true,
|
||||
"coloredToolbox": true,
|
||||
"monacoToolbox": true,
|
||||
"hasAudio": true,
|
||||
"blocklyOptions": {
|
||||
"grid": {
|
||||
"spacing": 45,
|
||||
|
@ -179,6 +179,7 @@ namespace pxsim.visuals {
|
||||
.sim-neopixel-canvas-parent:hover {
|
||||
transform-origin: center;
|
||||
transform: scale(4) translateY(-60px);
|
||||
-moz-transform: scale(4) translateY(-220px);
|
||||
}
|
||||
.sim-neopixel-canvas .hidden {
|
||||
visibility:hidden;
|
||||
|
@ -5,7 +5,8 @@
|
||||
"microbit-foundation"
|
||||
],
|
||||
"approvedRepos": [
|
||||
"CoderDojoOlney/pxt-olney"
|
||||
"CoderDojoOlney/pxt-olney",
|
||||
"PaulDFoster/pxt-microbit-GY521"
|
||||
]
|
||||
}
|
||||
}
|
@ -45,7 +45,7 @@
|
||||
Blockly
|
||||
*******************************/
|
||||
|
||||
.blocklyTreeRow {
|
||||
div.blocklyTreeRow {
|
||||
border-bottom: 1px solid #ecf0f1 !important;
|
||||
margin-bottom: 0px !important;
|
||||
|
||||
@ -56,7 +56,7 @@
|
||||
}
|
||||
|
||||
/* Blockly toolbox font size same as the page font */
|
||||
.blocklyTreeLabel {
|
||||
span.blocklyTreeLabel {
|
||||
font-family: @pageFont !important;
|
||||
font-weight: 200;
|
||||
}
|
||||
|
Reference in New Issue
Block a user