From d7c3f1b50aee3cf9821c99f37f2de8b15f5bdbea Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Fri, 15 Apr 2016 16:15:08 -0700 Subject: [PATCH] various docs fixes --- docs/lessons/stem.md | 2 +- docs/reference/basic/forever.md | 2 +- docs/reference/basic/show-animation.md | 2 +- docs/reference/basic/show-leds.md | 2 +- docs/reference/basic/show-string.md | 2 +- docs/reference/devices/on-gamepad-button.md | 9 ++------- .../devices/on-signal-strength-changed.md | 10 ++-------- docs/reference/devices/raise-alert-to.md | 9 ++------- docs/reference/devices/receive-number.md | 10 ++-------- docs/reference/devices/signal-strength.md | 10 ++-------- docs/reference/event-handler.md | 2 +- docs/reference/game/change-score-by.md | 16 ++-------------- 12 files changed, 18 insertions(+), 58 deletions(-) diff --git a/docs/lessons/stem.md b/docs/lessons/stem.md index 1925b85b..8cdb86be 100644 --- a/docs/lessons/stem.md +++ b/docs/lessons/stem.md @@ -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 * [Spinner](/lessons/spinner), spin the arrow with multiple 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) ### ~ diff --git a/docs/reference/basic/forever.md b/docs/reference/basic/forever.md index b860a8db..9b4a0a24 100644 --- a/docs/reference/basic/forever.md +++ b/docs/reference/basic/forever.md @@ -57,7 +57,7 @@ input.onButtonPressed(Button.A, () => { ### 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 diff --git a/docs/reference/basic/show-animation.md b/docs/reference/basic/show-animation.md index fa5f07ac..2b7bef83 100644 --- a/docs/reference/basic/show-animation.md +++ b/docs/reference/basic/show-animation.md @@ -57,5 +57,5 @@ Use [forever](/reference/basic/forever) to continually repeat an animation ### 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) diff --git a/docs/reference/basic/show-leds.md b/docs/reference/basic/show-leds.md index 1e49fbcb..45a6d057 100644 --- a/docs/reference/basic/show-leds.md +++ b/docs/reference/basic/show-leds.md @@ -41,5 +41,5 @@ In JavaScript, the led off is represented by a `.` and the led on by a `#` chara ### 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) diff --git a/docs/reference/basic/show-string.md b/docs/reference/basic/show-string.md index ec94a901..510b6ee8 100644 --- a/docs/reference/basic/show-string.md +++ b/docs/reference/basic/show-string.md @@ -37,5 +37,5 @@ basic.showString(s) ### 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) diff --git a/docs/reference/devices/on-gamepad-button.md b/docs/reference/devices/on-gamepad-button.md index 335b8834..8c28f3ad 100644 --- a/docs/reference/devices/on-gamepad-button.md +++ b/docs/reference/devices/on-gamepad-button.md @@ -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. -### Block Editor -![](/static/mb/on-gamepad-button-0.png) - -### KindScript - -``` -export function onGamepadButton(name: string, body:td.Action) +```sig +devices.onGamepadButton(MesDpadButtonInfo.ADown, () => {}) ``` ### Parameters diff --git a/docs/reference/devices/on-signal-strength-changed.md b/docs/reference/devices/on-signal-strength-changed.md index 6fdb8e30..ddc6d918 100644 --- a/docs/reference/devices/on-signal-strength-changed.md +++ b/docs/reference/devices/on-signal-strength-changed.md @@ -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. -### Block Editor - -![](/static/mb/on-signal-strength-changed-0.png) - -### KindScript - -``` -export function onSignalStrengthChanged(body:td.Action) +```sig +devices.onSignalStrengthChanged(() => {}) ``` ### Parameters diff --git a/docs/reference/devices/raise-alert-to.md b/docs/reference/devices/raise-alert-to.md index 1e311c5e..c467e6af 100644 --- a/docs/reference/devices/raise-alert-to.md +++ b/docs/reference/devices/raise-alert-to.md @@ -4,19 +4,14 @@ The raise alert to function. 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 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) - -### KindScript - -``` +```sig export function raiseAlertTo(event: string) ``` diff --git a/docs/reference/devices/receive-number.md b/docs/reference/devices/receive-number.md index 87c68e0b..d433d6a6 100644 --- a/docs/reference/devices/receive-number.md +++ b/docs/reference/devices/receive-number.md @@ -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. -### Block Editor - -![](/static/mb/receive-number-0.png) - -### KindScript - -``` -export function receiveNumber() : number +```sig +radio.receiveNumber(); ``` ### Returns diff --git a/docs/reference/devices/signal-strength.md b/docs/reference/devices/signal-strength.md index 4f7642ff..549a2fe7 100644 --- a/docs/reference/devices/signal-strength.md +++ b/docs/reference/devices/signal-strength.md @@ -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). -## 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 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 diff --git a/docs/reference/event-handler.md b/docs/reference/event-handler.md index 426a6b8e..73a249e8 100644 --- a/docs/reference/event-handler.md +++ b/docs/reference/event-handler.md @@ -55,5 +55,5 @@ To learn more about how the BBC micro:bit queues up and schedules event handlers ### 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) diff --git a/docs/reference/game/change-score-by.md b/docs/reference/game/change-score-by.md index e62bfe24..e878e7a8 100644 --- a/docs/reference/game/change-score-by.md +++ b/docs/reference/game/change-score-by.md @@ -1,20 +1,8 @@ # 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. -![](/static/mb/change-score-by-0.png) - -## 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. - -``` +```blocks input.onButtonPressed(Button.A, () => { game.addScore(1) }) @@ -39,5 +27,5 @@ export function score() : number ### 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)