From 0ecf3dc2b4ea0f1a676f923b25d26e25807820d8 Mon Sep 17 00:00:00 2001 From: Ron Hale-Evans Date: Thu, 23 Jun 2016 14:29:32 -0700 Subject: [PATCH 1/2] Rewrote in simple language. Updated example (needs work). --- docs/reference/pins/analog-read-pin.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/reference/pins/analog-read-pin.md b/docs/reference/pins/analog-read-pin.md index 12768b3f..fceccfe0 100644 --- a/docs/reference/pins/analog-read-pin.md +++ b/docs/reference/pins/analog-read-pin.md @@ -9,19 +9,20 @@ pins.analogReadPin(AnalogPin.P0) ### Parameters -* a [string](/reference/types/string) that stores the pin you say (`P0` through `P4`, or `P10`) +* a [string](/reference/types/string) that stores the name of the pin + you say (`P0` through `P4`, or `P10`) ### Returns -* a [number](/reference/types/number) from `0` through `1024` +* a [number](/reference/types/number) from `0` through `1023` -This program reads pin `P1` and shows the number as a -[bar graph](/reference/led/plot-bar-graph). +This program reads pin `P1` and shows the number +on the LED screen. ```blocks basic.forever(() => { let value = pins.analogReadPin(AnalogPin.P1) - led.plotBarGraph(value, 1023) + basic.showNumber(value) }); ``` @@ -32,4 +33,3 @@ basic.forever(() => { [analog write pin](/reference/pins/analog-write-pin), [digital read pin](/reference/pins/digital-read-pin), [digital write pin](/reference/pins/digital-write-pin) - From 8617f0f3b496d059bfccd8dc96bc0e5ebd628b54 Mon Sep 17 00:00:00 2001 From: Ron Hale-Evans Date: Thu, 23 Jun 2016 15:25:56 -0700 Subject: [PATCH 2/2] Expanded stub. Rewrote in simple language. --- docs/reference/control/reset.md | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/docs/reference/control/reset.md b/docs/reference/control/reset.md index 16c985ee..59ba8cbe 100644 --- a/docs/reference/control/reset.md +++ b/docs/reference/control/reset.md @@ -1,8 +1,37 @@ # Reset -Reset the BBC micro:bit (as if you pushed the reset button on the back of the device), which causes the program to start again. +Reset the BBC micro:bit and start the program again. + +This function is like pressing the reset button on the back of the micro:bit. ```sig control.reset() ``` +### Example + +This program will count as high as you like when you press button `A`. +When you get tired of counting, press button `B` to reset the +micro:bit and start the program over. + +```blocks +let item = 0; +basic.showNumber(item); +input.onButtonPressed(Button.A, () => { + item = item + 1; + basic.showNumber(item); +}); +input.onButtonPressed(Button.B, () => { + control.reset(); +}); +``` + +#### ~hint + +This program works better on a real micro:bit than in the simulator. + +#### ~ + +### See Also + +[clear screen](/reference/basic/clear-screen), [game over](/reference/game/game-over)