various docs fixes

This commit is contained in:
Peli de Halleux 2016-04-15 16:15:08 -07:00
parent 2fb6025848
commit d7c3f1b50a
12 changed files with 18 additions and 58 deletions

View File

@ -42,7 +42,7 @@ Overview of Blocks lessons for the BBC micro:bit.
* [Truth or dare](/lessons/truth-or-dare), a game that forces each player to reveal a secret or do something funny with if statement * [Truth or dare](/lessons/truth-or-dare), a game that forces each player to reveal a secret or do something funny with if statement
* [Spinner](/lessons/spinner), spin the arrow with multiple if statements * [Spinner](/lessons/spinner), spin the arrow with multiple if statements
* [Die roll](/lessons/die-roll), spin with more if statements * [Die roll](/lessons/die-roll), spin with more if statements
* [Beatbox](/lessons/beatbox), make a beatbox music player with variables * [Beatbox](/lessons/classic-beatbox), make a beatbox music player with variables
* [Temperature](/lessons/temperature), get the ambient temperature (degree Celsius °C) * [Temperature](/lessons/temperature), get the ambient temperature (degree Celsius °C)
### ~ ### ~

View File

@ -57,7 +57,7 @@ input.onButtonPressed(Button.A, () => {
### Lessons ### Lessons
[blink](/lessons/blink), [bounce-image](/lessons/bounce-image), [snowflake-fall](/lessons/snowflake-fall), [flashing-heart](/lessons/flashing-heart) [blink](/lessons/blink), [snowflake-fall](/lessons/snowflake-fall), [flashing-heart](/lessons/flashing-heart)
### See also ### See also

View File

@ -57,5 +57,5 @@ Use [forever](/reference/basic/forever) to continually repeat an animation
### Lessons ### Lessons
[smiley](/lessons/smiley), [bounce image](/lessons/bounce-image), [snowflake fall](/lessons/snowflake-fall), [rotation animation](/lessons/rotation-animation) [smiley](/lessons/smiley), [snowflake fall](/lessons/snowflake-fall), [rotation animation](/lessons/rotation-animation)

View File

@ -41,5 +41,5 @@ In JavaScript, the led off is represented by a `.` and the led on by a `#` chara
### See also ### See also
[plot leds](/reference/led/plot-leds), [show animation](/reference/led/show-animation) [plot leds](/reference/led/plot-leds), [show animation](/reference/basic/show-animation)

View File

@ -37,5 +37,5 @@ basic.showString(s)
### See also ### See also
[String](/reference/types/string), [string functions](/reference/types/string-functions), [show number](/reference/basic/show-number), [show animation](/reference/basic/show-animation) [String](/reference/types/string), [show number](/reference/basic/show-number), [show animation](/reference/basic/show-animation)

View File

@ -8,14 +8,9 @@ The functions in the ``devices`` namespace allow the BBC micro:bit to communicat
The set of supported events will depend on the remote device and the BBC micro:bit apps available for the remote device. The set of supported events will depend on the remote device and the BBC micro:bit apps available for the remote device.
### Block Editor
![](/static/mb/on-gamepad-button-0.png) ```sig
devices.onGamepadButton(MesDpadButtonInfo.ADown, () => {})
### KindScript
```
export function onGamepadButton(name: string, body:td.Action)
``` ```
### Parameters ### Parameters

View File

@ -10,14 +10,8 @@ The functions in the ``devices`` namespace allow the BBC micro:bit to communicat
The set of supported events will depend on the remote device and the BBC micro:bit apps available for the remote device. The set of supported events will depend on the remote device and the BBC micro:bit apps available for the remote device.
### Block Editor ```sig
devices.onSignalStrengthChanged(() => {})
![](/static/mb/on-signal-strength-changed-0.png)
### KindScript
```
export function onSignalStrengthChanged(body:td.Action)
``` ```
### Parameters ### Parameters

View File

@ -4,19 +4,14 @@ The raise alert to function.
Raise an alert on a remote device. Raise an alert on a remote device.
## ## Bluetooth required
The functions in the ``devices`` namespace allow the BBC micro:bit to communicate with a separate (remote) device, such as a smartphone, over Bluetooth (Smart). The functions in the ``devices`` namespace allow the BBC micro:bit to communicate with a separate (remote) device, such as a smartphone, over Bluetooth (Smart).
The set of supported events will depend on the remote device and the BBC micro:bit apps available for the remote device. The set of supported events will depend on the remote device and the BBC micro:bit apps available for the remote device.
### KindScript
![](/static/mb/raise-alert-to-0.png) ```sig
### KindScript
```
export function raiseAlertTo(event: string) export function raiseAlertTo(event: string)
``` ```

View File

@ -12,14 +12,8 @@ This API does not contain any form of encryption, authentication or authorizatio
For serious applications, BLE should be considered a substantially more secure alternative. For serious applications, BLE should be considered a substantially more secure alternative.
### Block Editor ```sig
radio.receiveNumber();
![](/static/mb/receive-number-0.png)
### KindScript
```
export function receiveNumber() : number
``` ```
### Returns ### Returns

View File

@ -4,20 +4,14 @@ The `signal strength` function.
Returns the signal strength reported by the paired device from ``0`` (no signal) to ``4`` (full strength). Returns the signal strength reported by the paired device from ``0`` (no signal) to ``4`` (full strength).
## Bluetooth required ## Important Security Consideration
The functions in the ``devices`` namespace allow the BBC micro:bit to communicate with a separate (remote) device, such as a smartphone, over Bluetooth (Smart). The functions in the ``devices`` namespace allow the BBC micro:bit to communicate with a separate (remote) device, such as a smartphone, over Bluetooth (Smart).
The set of supported events will depend on the remote device and the BBC micro:bit apps available for the remote device. The set of supported events will depend on the remote device and the BBC micro:bit apps available for the remote device.
### Block Editor
![](/static/mb/signal-strength-0.png)
### KindScript
``` ```
export function signalStrength() : number devices.signalStrength() : number
``` ```
### Returns ### Returns

View File

@ -55,5 +55,5 @@ To learn more about how the BBC micro:bit queues up and schedules event handlers
### see also ### see also
[on button pressed](/reference/input/on-button-pressed), [on logo up](/functions/on-logo-up), [on logo down](/functions/on-logo-down), [on screen up](/functions/on-screen-up), [on screen down](/functions/on-screen-down), [on shake](/reference/input/on-gesture), [on pin pressed](/reference/input/on-pin-pressed) [on button pressed](/reference/input/on-button-pressed), [on pin up](/reference/input/on-pin-pressed), [on shake](/reference/input/on-gesture)

View File

@ -1,20 +1,8 @@
# Change Score By # Change Score By
The game library
The game library supports simple single-player time-based games. The player will ** add points to score**.
## Block Editor
The code below shows a simple game where the user gets to press the button ``A`` as much times as possible and the score will display on the screen. The code below shows a simple game where the user gets to press the button ``A`` as much times as possible and the score will display on the screen.
![](/static/mb/change-score-by-0.png) ```blocks
## KindScript
The code below shows a simple game where the user gets to press the button ``A`` as much times as possible in 10 seconds.
```
input.onButtonPressed(Button.A, () => { input.onButtonPressed(Button.A, () => {
game.addScore(1) game.addScore(1)
}) })
@ -39,5 +27,5 @@ export function score() : number
### Lessons ### Lessons
[bop it](/lessons/bop-it) | [game of chance](/lessons/game-of-chance) | [game counter](/lessons/game-counter) [game of chance](/lessons/game-of-chance), [game counter](/lessons/game-counter)