various docs fixes

This commit is contained in:
Peli de Halleux 2016-04-15 15:53:20 -07:00
parent 4ee1799271
commit 8da3c5eb84
12 changed files with 23 additions and 40 deletions

View File

@ -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 ### 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 ```blocks
led.plot(0,0) led.plot(0,0)
@ -41,7 +41,7 @@ led.unplot(0,0)
### Is a LED on/off? ### 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 ```blocks
if(led.point(0,0)) { if(led.point(0,0)) {

View File

@ -31,12 +31,6 @@ Windows
Mac (picture bvabdbco) Mac (picture bvabdbco)
WARN: unknown picture: bvabdbco:5x3 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 ## Step 2: Compile your script
Next, 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 ### See also
[Run code in a browser](/js/simulator) [Run code in a browser](/device/simulator)

View File

@ -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) * **plot** : [read more...](/reference/led/plot)
* **if** : [read more...](/reference/logic/if) * **if** : [read more...](/reference/logic/if)
* **acceleration** : [read more...](/reference/input/acceleration) * **acceleration** : [read more...](/reference/input/acceleration)
* **math minimum number** : [read more...](/js/math) * **math minimum number** : [read more...](/reference/math)
* **math maximum number** : [read more...](/js/math) * **math maximum number** : [read more...](/reference/math)
* **math random number** : [read more...](/js/math) * **math random number** : [read more...](/reference/math)
* **math modulus** : [read more...](/js/math) * **math modulus** : [read more...](/reference/math)
* **show number** : [read more...](/reference/basic/show-number) * **show number** : [read more...](/reference/basic/show-number)
* **pause** : [read more...](/reference/basic/pause) * **pause** : [read more...](/reference/basic/pause)

View File

@ -42,13 +42,13 @@ Learn how to create a charades game with **collections**, ` create -> Collection
## Documentation ## Documentation
* **collection** * **collection**
* **global variables** : [read more...](/js/data) * **global variables** : [read more...](/reference/variables/globals.md)
* **Boolean** : [read more...](/reference/types/boolean) * **Boolean** : [read more...](/reference/types/boolean)
* **on logo up** [read more...](/functions/on-logo-up) * **on logo up** [read more...](/functions/on-logo-up)
* **on screen down** [read more...](/functions/on-screen-down) * **on screen down** [read more...](/functions/on-screen-down)
* **on screen up** [read more...](/functions/on-screen-up) * **on screen up** [read more...](/functions/on-screen-up)
* **show string** : [read more...](/reference/basic/show-string) * **show string** : [read more...](/reference/basic/show-string)
* **game library** : [read more...](/js/game-library) * **game library** : [read more...](/reference/game-library)
## Resources ## Resources

View File

@ -22,7 +22,7 @@ Learn how to declare a **Boolean** variable, `var t:= true` `var f:=false` for o
## Documentation ## Documentation
* **running time** : [read more...](/reference/input/running-time) * **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) * **Boolean** : [read more...](/reference/types/boolean)
* **on button pressed** : [read more...](/reference/input/on-button-pressed) * **on button pressed** : [read more...](/reference/input/on-button-pressed)
* **if** : [read more...](/reference/logic/if) * **if** : [read more...](/reference/logic/if)

View File

@ -61,5 +61,5 @@ input.onButtonPressed(Button.A, () => {
### See also ### 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)

View File

@ -27,5 +27,5 @@ for (let i = 0; i < 5; i++) {
### See also ### 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)

View File

@ -48,5 +48,5 @@ for (let i = 0; i < 5; i++) {
### See also ### 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)

View File

@ -37,13 +37,13 @@ export function tellMicrophoneTo(event: string)
To tell the connected device to start recording audio 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 To tell the connected device to stop recording audio
``` ```
antenna.tellMicrophoneTo("stop capture") devices.tellMicrophoneTo("stop capture")
``` ```
### Other show functions ### Other show functions
@ -54,5 +54,5 @@ antenna.tellMicrophoneTo("stop capture")
### See also ### See also
[Antenna](/js/antenna) [Devices](/reference/devices)

View File

@ -1,6 +1,6 @@
# On Button Pressed # 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 ```sig
input.onButtonPressed(Button.A, () => {}) input.onButtonPressed(Button.A, () => {})

View File

@ -2,17 +2,9 @@
The micro:bit pins. 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 ## 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 ## 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 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) ![](/static/mb/offline-2.png)

View File

@ -8,8 +8,8 @@ For example, the [plot](/reference/led/plot) function has two parameters:
### syntax ### syntax
``` ```sig
export function plot(x: number, y: number) led.plot(0,0)
``` ```
### parameters ### 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): 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) 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`: If you call the `point` function with an out of bounds parameter, the function returns `false`:
``` ```blocks
let on = led.point(5, -5) 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).