From 8da3c5eb8429117a6bceb84d5d5ff1c9542e5797 Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Fri, 15 Apr 2016 15:53:20 -0700 Subject: [PATCH] various docs fixes --- docs/device/screen.md | 4 ++-- docs/device/usb.md | 8 +------- docs/lessons/catch-the-egg-game.md | 8 ++++---- docs/lessons/headbands.md | 4 ++-- docs/lessons/speed-button.md | 2 +- docs/reference/basic/forever.md | 2 +- docs/reference/basic/pause.md | 2 +- docs/reference/basic/show-number.md | 2 +- docs/reference/devices/tell-microphone-to.md | 6 +++--- docs/reference/input/on-button-pressed.md | 2 +- docs/reference/offline.md | 12 ++---------- docs/reference/out-of-bounds.md | 11 ++++------- 12 files changed, 23 insertions(+), 40 deletions(-) diff --git a/docs/device/screen.md b/docs/device/screen.md index 5454d2a7..e7d1ec1b 100644 --- a/docs/device/screen.md +++ b/docs/device/screen.md @@ -32,7 +32,7 @@ Since the row and column numbers start at 0, an easy way to figure out the x, y ### Turn a LED on/off -Use [plot](/led/plot) and [unplot](/led/unplot) to turn a LED on or off +Use [plot](/reference/led/plot) and [unplot](/reference/led/unplot) to turn a LED on or off ```blocks led.plot(0,0) @@ -41,7 +41,7 @@ led.unplot(0,0) ### Is a LED on/off? -Use the [point](/led/point) function to find out if a LED is on or off. +Use the [point](/reference/led/point) function to find out if a LED is on or off. ```blocks if(led.point(0,0)) { diff --git a/docs/device/usb.md b/docs/device/usb.md index 0c8180af..889e28fb 100644 --- a/docs/device/usb.md +++ b/docs/device/usb.md @@ -31,12 +31,6 @@ Windows Mac (picture bvabdbco) WARN: unknown picture: bvabdbco:5x3 -### ~hide - -If your computer doesn't recognise your micro:bit, please see [troubleshooting USB problems](/diagnosing-usb). - -### ~ - ## Step 2: Compile your script Next, compile your script: @@ -133,5 +127,5 @@ Or it may appear that there are two hex files on your micro:bit so the micro:bit ### See also -[Run code in a browser](/js/simulator) +[Run code in a browser](/device/simulator) diff --git a/docs/lessons/catch-the-egg-game.md b/docs/lessons/catch-the-egg-game.md index 7a166741..36ede269 100644 --- a/docs/lessons/catch-the-egg-game.md +++ b/docs/lessons/catch-the-egg-game.md @@ -26,10 +26,10 @@ Learn how to create a catch the egg game game with **plot**, `led->plot` , **unp * **plot** : [read more...](/reference/led/plot) * **if** : [read more...](/reference/logic/if) * **acceleration** : [read more...](/reference/input/acceleration) -* **math minimum number** : [read more...](/js/math) -* **math maximum number** : [read more...](/js/math) -* **math random number** : [read more...](/js/math) -* **math modulus** : [read more...](/js/math) +* **math minimum number** : [read more...](/reference/math) +* **math maximum number** : [read more...](/reference/math) +* **math random number** : [read more...](/reference/math) +* **math modulus** : [read more...](/reference/math) * **show number** : [read more...](/reference/basic/show-number) * **pause** : [read more...](/reference/basic/pause) diff --git a/docs/lessons/headbands.md b/docs/lessons/headbands.md index d6dc4e68..1ba22641 100644 --- a/docs/lessons/headbands.md +++ b/docs/lessons/headbands.md @@ -42,13 +42,13 @@ Learn how to create a charades game with **collections**, ` create -> Collection ## Documentation * **collection** -* **global variables** : [read more...](/js/data) +* **global variables** : [read more...](/reference/variables/globals.md) * **Boolean** : [read more...](/reference/types/boolean) * **on logo up** [read more...](/functions/on-logo-up) * **on screen down** [read more...](/functions/on-screen-down) * **on screen up** [read more...](/functions/on-screen-up) * **show string** : [read more...](/reference/basic/show-string) -* **game library** : [read more...](/js/game-library) +* **game library** : [read more...](/reference/game-library) ## Resources diff --git a/docs/lessons/speed-button.md b/docs/lessons/speed-button.md index 3cbfc5bd..638c09bb 100644 --- a/docs/lessons/speed-button.md +++ b/docs/lessons/speed-button.md @@ -22,7 +22,7 @@ Learn how to declare a **Boolean** variable, `var t:= true` `var f:=false` for o ## Documentation * **running time** : [read more...](/reference/input/running-time) -* **global variable** : [read more...](/js/data) +* **global variable** : [read more...](/reference/variables/globals) * **Boolean** : [read more...](/reference/types/boolean) * **on button pressed** : [read more...](/reference/input/on-button-pressed) * **if** : [read more...](/reference/logic/if) diff --git a/docs/reference/basic/forever.md b/docs/reference/basic/forever.md index f399d161..b860a8db 100644 --- a/docs/reference/basic/forever.md +++ b/docs/reference/basic/forever.md @@ -61,5 +61,5 @@ input.onButtonPressed(Button.A, () => { ### See also -[while](/js/while), [on button pressed](/reference/input/on-button-pressed), [in background](/reference/control/in-background) +[while](/reference/loops/while), [on button pressed](/reference/input/on-button-pressed), [in background](/reference/control/in-background) diff --git a/docs/reference/basic/pause.md b/docs/reference/basic/pause.md index c48efcac..776be176 100644 --- a/docs/reference/basic/pause.md +++ b/docs/reference/basic/pause.md @@ -27,5 +27,5 @@ for (let i = 0; i < 5; i++) { ### See also -[while](/js/while), [running time](/reference/input/running-time), [for](/reference/loops/for) +[while](/reference/loops/while), [running time](/reference/input/running-time), [for](/reference/loops/for) diff --git a/docs/reference/basic/show-number.md b/docs/reference/basic/show-number.md index 9a477824..16cc8c6f 100644 --- a/docs/reference/basic/show-number.md +++ b/docs/reference/basic/show-number.md @@ -48,5 +48,5 @@ for (let i = 0; i < 5; i++) { ### See also -[show string](/reference/basic/show-string), [show animation](/reference/basic/show-animation), [Number](/reference/types/number), [math library](/js/math) +[show string](/reference/basic/show-string), [show animation](/reference/basic/show-animation), [Number](/reference/types/number), [math library](/reference/math) diff --git a/docs/reference/devices/tell-microphone-to.md b/docs/reference/devices/tell-microphone-to.md index 9f63d116..27251dc4 100644 --- a/docs/reference/devices/tell-microphone-to.md +++ b/docs/reference/devices/tell-microphone-to.md @@ -37,13 +37,13 @@ export function tellMicrophoneTo(event: string) To tell the connected device to start recording audio ``` -antenna.tellMicrophoneTo("start capture") +devices.tellMicrophoneTo("start capture") ``` To tell the connected device to stop recording audio ``` -antenna.tellMicrophoneTo("stop capture") +devices.tellMicrophoneTo("stop capture") ``` ### Other show functions @@ -54,5 +54,5 @@ antenna.tellMicrophoneTo("stop capture") ### See also -[Antenna](/js/antenna) +[Devices](/reference/devices) diff --git a/docs/reference/input/on-button-pressed.md b/docs/reference/input/on-button-pressed.md index e95adfcc..8d262566 100644 --- a/docs/reference/input/on-button-pressed.md +++ b/docs/reference/input/on-button-pressed.md @@ -1,6 +1,6 @@ # On Button Pressed -Register an [event handler](/reference/event-handler) that will execute whenever an input button (A, B, or A and B together) is pressed during program execution. When [running code](/js/simulator) with this function in a web browser, click an on-screen input button - labelled A or B. +Register an [event handler](/reference/event-handler) that will execute whenever an input button (A, B, or A and B together) is pressed during program execution. When [running code](/device/simulator) with this function in a web browser, click an on-screen input button - labelled A or B. ```sig input.onButtonPressed(Button.A, () => {}) diff --git a/docs/reference/offline.md b/docs/reference/offline.md index 6ed67f79..2ff572c9 100644 --- a/docs/reference/offline.md +++ b/docs/reference/offline.md @@ -2,17 +2,9 @@ The micro:bit pins. -## We listened to your feedback! - -Following the feedback from teachers, the following improvements were made: - -* compile without signing in -* compile offline -* save and load code using files - ## How to work offline -If you have loaded the web app at some time in the past (by clicking on "my scripts" from the home page), then if you later open the same browser (whether you are online or offline) and type in the URL KINDSCRIPTWEBSITE, you will be able to access all the features of the web app. Note that it is important to end the URL with "/". +If you have loaded the web app at some time in the past (by clicking on "my scripts" from the home page), then if you later open the same browser (whether you are online or offline) and type in [https://codemicrobit.com/](https://codemicrobit.com/), you will be able to access all the features of the web app. Note that it is important to end the URL with "/". ## Save and load code using files @@ -24,7 +16,7 @@ The micro:bit automatically saves and synchronises scripts for signed-in users t ## The new in-browser compiler -The compilation from a script to ARM machine code is now done entirely in the browser (read the [in depth story](https://www.touchdevelop.com/docs/touch-develop-in-208-bits) about building the compiler). The new compiler is used by the Block Editor, Touch Develop and Code Kingdoms to create a .hex file solely within the confines of your web browser (no Internet connection is needed). The micro:bit compilation process (see page 10 in the [Quick Start Guide](/js/quick-start)) has been updated below to reflect the new compiler architecture, as shown below: +The compilation from a script to ARM machine code is now done entirely in the browser (read the [in depth story](https://www.touchdevelop.com/docs/touch-develop-in-208-bits) about building the compiler). The new compiler is used by the Block Editor, Touch Develop and Code Kingdoms to create a .hex file solely within the confines of your web browser (no Internet connection is needed). The micro:bit compilation process is shown below: ![](/static/mb/offline-2.png) diff --git a/docs/reference/out-of-bounds.md b/docs/reference/out-of-bounds.md index eeaf1989..a052a4e3 100644 --- a/docs/reference/out-of-bounds.md +++ b/docs/reference/out-of-bounds.md @@ -8,8 +8,8 @@ For example, the [plot](/reference/led/plot) function has two parameters: ### syntax -``` -export function plot(x: number, y: number) +```sig +led.plot(0,0) ``` ### parameters @@ -21,7 +21,7 @@ export function plot(x: number, y: number) here's an example of code with an out of bounds parameter (the *x* and *y* parameters are outside the expected range of 0-4): -``` +```blocks led.plot(9, -21) ``` @@ -33,11 +33,8 @@ Typically, when a parameter supplied to a function is out of bounds that functio If you call the `point` function with an out of bounds parameter, the function returns `false`: -``` +```blocks let on = led.point(5, -5) ``` -### see also - -For more information on the out-of-bounds behavior of a function, see the documentation for that [function](/js/contents).