various docs fixes
This commit is contained in:
@ -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)
|
||||
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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, () => {})
|
||||
|
@ -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:
|
||||
|
||||

|
||||
|
||||
|
@ -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).
|
||||
|
||||
|
Reference in New Issue
Block a user