fix broken links
This commit is contained in:
parent
0e08b58f84
commit
041b10ef04
@ -31,7 +31,7 @@ Just like Arduino, the micro:bit can be connected to and interact with sensors,
|
|||||||
|
|
||||||
## Blocks or JavaScript
|
## Blocks or JavaScript
|
||||||
|
|
||||||
The student can program the BBC micro:bit using Blocks or JavaScript.
|
The student can program the BBC micro:bit using [Blocks](/blocks) or [JavaScript](/typescript), via the [micro:bit APIs](/reference):
|
||||||
|
|
||||||
```blocks
|
```blocks
|
||||||
basic.showString("Hi!");
|
basic.showString("Hi!");
|
||||||
@ -41,7 +41,7 @@ basic.showString("Hi!");
|
|||||||
|
|
||||||
When a user has her code ready, she can connect her BBC micro:bit to a computer via a USB cable, so it appears as a mounted drive (named MICROBIT).
|
When a user has her code ready, she can connect her BBC micro:bit to a computer via a USB cable, so it appears as a mounted drive (named MICROBIT).
|
||||||
|
|
||||||
Compilation to the ARM thumb machine code happens in the browser.
|
Compilation to ARM thumb machine code from [Blocks](/blocks) or [JavaScript](/typescript) happens in the browser.
|
||||||
|
|
||||||
The student is prompted to save the ARM binary program to a file, which she then simply drags to the micro:bit mounted drive,
|
The student is prompted to save the ARM binary program to a file, which she then simply drags to the micro:bit mounted drive,
|
||||||
which flashes the micro:bit device with the new program.
|
which flashes the micro:bit device with the new program.
|
||||||
@ -56,7 +56,7 @@ The simulator has support for the LED screen, buttons, as well as compass, accel
|
|||||||
The [C++ BBC micro:bit runtime](http://lancaster-university.github.io/microbit-docs/), created at [Lancaster University](http://www.lancaster.ac.uk/), provides access to the hardware functions of the micro:bit,
|
The [C++ BBC micro:bit runtime](http://lancaster-university.github.io/microbit-docs/), created at [Lancaster University](http://www.lancaster.ac.uk/), provides access to the hardware functions of the micro:bit,
|
||||||
as well as a set of helper functions (such as displaying a number/image/string on the LED screen).
|
as well as a set of helper functions (such as displaying a number/image/string on the LED screen).
|
||||||
|
|
||||||
The JavaScript micro:bit library mirrors the functions of the C++ library.
|
The [micro:bit library](/reference) mirrors the functions of the C++ library.
|
||||||
When code is compiled to ARM machine code, the calls to JavaScript micro:bit functions are replaced with calls to the corresponding C++ functions.
|
When code is compiled to ARM machine code, the calls to JavaScript micro:bit functions are replaced with calls to the corresponding C++ functions.
|
||||||
|
|
||||||
## Open Source
|
## Open Source
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
### @parent blocks/language
|
### @parent blocks/language
|
||||||
|
|
||||||
|
|
||||||
Conditionally run code depending on whether a [Boolean](/reference/types/boolean) condition is true or false.
|
Conditionally run code depending on whether a [Boolean](/blocks/logic/boolean) condition is true or false.
|
||||||
|
|
||||||
```blocks
|
```blocks
|
||||||
if(true) {
|
if(true) {
|
||||||
@ -24,5 +24,5 @@ If the [light level](/reference/input/light-level) is `< 100`, this code sets th
|
|||||||
|
|
||||||
### See also
|
### See also
|
||||||
|
|
||||||
[while loop](/blocks/loops/while), [for](/blocks/loops/for), [boolean](/reference/types/boolean)
|
[while loop](/blocks/loops/while), [for](/blocks/loops/for), [boolean](/blocks/logic/boolean)
|
||||||
|
|
||||||
|
@ -1,16 +1,13 @@
|
|||||||
# While
|
# While
|
||||||
|
|
||||||
### @parent blocks/language
|
Repeat code while a [Boolean](/blocks/logic/boolean) `condition` is true.
|
||||||
|
|
||||||
|
|
||||||
Repeat code while a [Boolean](/reference/types/boolean) `condition` is true.
|
|
||||||
|
|
||||||
```blocks
|
```blocks
|
||||||
while(true) {
|
while(true) {
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
The while loop has a *condition* that evaluates to a [Boolean](/reference/types/boolean) value. After the `do` keyword, add the code that you want to run while the `condition` is `true`. The while loop concludes with `end while`.
|
The while loop has a *condition* that evaluates to a [Boolean](/blocks/logic/boolean) value. After the `do` keyword, add the code that you want to run while the `condition` is `true`. The while loop concludes with `end while`.
|
||||||
|
|
||||||
The condition is tested before any code runs. Which means that if the condition is false, the code inside the loop doesn't execute.
|
The condition is tested before any code runs. Which means that if the condition is false, the code inside the loop doesn't execute.
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ basic.showLeds(`
|
|||||||
`)
|
`)
|
||||||
```
|
```
|
||||||
|
|
||||||
* **variable**: [read more...](/reference/variables/var)
|
* **variable**: [read more...](/blocks/variables)
|
||||||
* **arithmetic operators**: [read more...](/reference/types/number)
|
* **arithmetic operators**: [read more...](/reference/types/number)
|
||||||
* **on button pressed** : [read more...](/reference/input/on-button-pressed)
|
* **on button pressed** : [read more...](/reference/input/on-button-pressed)
|
||||||
* **show number** : [read more...](/reference/basic/show-number)
|
* **show number** : [read more...](/reference/basic/show-number)
|
||||||
|
@ -42,19 +42,18 @@ Learn how to create a charades game with **collections**, ` create -> Collection
|
|||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
* **collection**
|
* **collection**
|
||||||
* **global variables** : [read more...](/reference/variables/globals.md)
|
* **variables** : [read more...](/blocks/variables)
|
||||||
* **Boolean** : [read more...](/reference/types/boolean)
|
* **Boolean** : [read more...](/blocks/logic/boolean)
|
||||||
* **on logo up** [read more...](/functions/on-logo-up)
|
* **on logo up** [read more...](/reference/input/on-gesture)
|
||||||
* **on screen down** [read more...](/functions/on-screen-down)
|
* **on screen down** [read more...](/reference/input/on-gesture)
|
||||||
* **on screen up** [read more...](/functions/on-screen-up)
|
* **on screen up** [read more...](/reference/input/on-gesture)
|
||||||
* **show string** : [read more...](/reference/basic/show-string)
|
* **show string** : [read more...](/reference/basic/show-string)
|
||||||
* **game library** : [read more...](/reference/game-library)
|
* **game library** : [read more...](/reference/game)
|
||||||
|
|
||||||
## Resources
|
## Resources
|
||||||
|
|
||||||
* Activity: [tutorial](/lessons/headbands/activity)
|
* Activity: [tutorial](/lessons/headbands/activity)
|
||||||
* Activity: [quiz](/lessons/headbands/quiz)
|
* Quiz: [quiz](/lessons/headbands/quiz)
|
||||||
* Extended Activity: [challenges](/lessons/headbands/challenges)
|
|
||||||
|
|
||||||
## Objectives
|
## Objectives
|
||||||
|
|
||||||
|
@ -22,10 +22,10 @@ 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...](/reference/variables/globals)
|
* **variable** : [read more...](/blocks/variables)
|
||||||
* **Boolean** : [read more...](/reference/types/boolean)
|
* **Boolean** : [read more...](/blocks/logic/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...](/blocks/logic/if)
|
||||||
* **show string** : [read more...](/reference/basic/show-string)
|
* **show string** : [read more...](/reference/basic/show-string)
|
||||||
|
|
||||||
## Objectives
|
## Objectives
|
||||||
|
@ -9,9 +9,9 @@ Overview of Blocks lessons for the BBC micro:bit.
|
|||||||
## Science
|
## Science
|
||||||
|
|
||||||
* [Night Light](/lessons/night-light), dim the LEDs with set brightness
|
* [Night Light](/lessons/night-light), dim the LEDs with set brightness
|
||||||
* [Hack your headphones](/lessons/hack-your-headphones), create music on the BBC micro:bit by hacking your headphones
|
* [Hack your headphones](/projects/hack-your-headphones), create music on the BBC micro:bit by hacking your headphones
|
||||||
* [Banana Keyboard](/lessons/banana-keyboard), create music with fruits
|
* [Banana Keyboard](/projects/banana-keyboard), create music with fruits
|
||||||
* [Telegraph](/lessons/telegraph), play the telegraph game between 2 BBC micro:bits
|
* [Telegraph](/projects/telegraph), play the telegraph game between 2 BBC micro:bits
|
||||||
* [Zoomer](/lessons/zoomer), measure the force with acceleration
|
* [Zoomer](/lessons/zoomer), measure the force with acceleration
|
||||||
* [Glowing pendulum](/lessons/glowing-pendulum), construct a pendulum that glows using acceleration
|
* [Glowing pendulum](/lessons/glowing-pendulum), construct a pendulum that glows using acceleration
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ To figure out the ``x``, ``y`` coordinates, see [LED screen](/device/screen).
|
|||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
* [Boolean](/reference/types/boolean) - `true` for on and `false` for off
|
* [Boolean](/blocks/logic/boolean) - `true` for on and `false` for off
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ export function setPixel(_this: micro_bit.Image, x: number, y: number, value: bo
|
|||||||
|
|
||||||
* x - [Number](/reference/types/number); the *x coordinate* or horizontal position of a pixel in an [image](/reference/images/image)
|
* x - [Number](/reference/types/number); the *x coordinate* or horizontal position of a pixel in an [image](/reference/images/image)
|
||||||
* x - [Number](/reference/types/number); the *y coordinate* or vertical position of a pixel in an [image](/reference/images/image)
|
* x - [Number](/reference/types/number); the *y coordinate* or vertical position of a pixel in an [image](/reference/images/image)
|
||||||
* value -[Boolean](/reference/types/boolean); the on/off state of a pixel; `true` for on, `false` for off
|
* value -[Boolean](/blocks/logic/boolean); the on/off state of a pixel; `true` for on, `false` for off
|
||||||
|
|
||||||
### x, y coordinates?
|
### x, y coordinates?
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ input.buttonIsPressed(Button.A);
|
|||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
* [Boolean](/reference/types/boolean) that is `true` if the button you are checking is pressed, `false` if it is not pressed.
|
* [Boolean](/blocks/logic/boolean) that is `true` if the button you are checking is pressed, `false` if it is not pressed.
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ instead of the USB cable.
|
|||||||
|
|
||||||
### returns
|
### returns
|
||||||
|
|
||||||
* a [boolean](/reference/types/boolean) that means whether the pin you say is pressed (`true` or `false`)
|
* a [boolean](/blocks/logic/boolean) that means whether the pin you say is pressed (`true` or `false`)
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ other than 0 to 4), this function will return `false`.
|
|||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
* a [boolean](/reference/types/boolean). If it is `true`, that means the LED is on. If it is `false`, that means the LED is off.
|
* a [boolean](/blocks/logic/boolean). If it is `true`, that means the LED is on. If it is `false`, that means the LED is off.
|
||||||
|
|
||||||
### ~hint
|
### ~hint
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ radio.onDataReceived(() => {
|
|||||||
|
|
||||||
### Example: Light level receiver
|
### Example: Light level receiver
|
||||||
|
|
||||||
This example shows the light level from the [light level sender example](/reference/input/send-number)
|
This example shows the light level from the [light level sender example](/reference/radio/send-number)
|
||||||
as a number.
|
as a number.
|
||||||
|
|
||||||
```blocks
|
```blocks
|
||||||
@ -36,7 +36,7 @@ basic.forever(() => {
|
|||||||
|
|
||||||
### Example: Mailbot
|
### Example: Mailbot
|
||||||
|
|
||||||
This example receives the light level from the [light level sender example](/reference/input/send-number)
|
This example receives the light level from the [light level sender example](/reference/radio/send-number)
|
||||||
and shows a text string like **ALERT** if the light level becomes much brighter.
|
and shows a text string like **ALERT** if the light level becomes much brighter.
|
||||||
To find when the mail arrives, you can put the light level sender in your mailbox and it will
|
To find when the mail arrives, you can put the light level sender in your mailbox and it will
|
||||||
tell you when someone opens the box. You can try this with a normal
|
tell you when someone opens the box. You can try this with a normal
|
||||||
@ -58,5 +58,5 @@ basic.forever(() => {
|
|||||||
|
|
||||||
### See also
|
### See also
|
||||||
|
|
||||||
[send number](/reference/input/send-number), [on data received](/reference/radio/on-data-received)
|
[send number](/reference/radio/send-number), [on data received](/reference/radio/on-data-received)
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ This function only works on the micro:bit, not in browsers.
|
|||||||
### Example
|
### Example
|
||||||
|
|
||||||
This example shows how strong the radio signal of the
|
This example shows how strong the radio signal of the
|
||||||
[light level sender example](/reference/input/send-number) is.
|
[light level sender example](/reference/radio/send-number) is.
|
||||||
|
|
||||||
```blocks
|
```blocks
|
||||||
let x = 0;
|
let x = 0;
|
||||||
|
@ -27,7 +27,7 @@ The following arithmetic operators work on numbers and return a [Number](/refere
|
|||||||
|
|
||||||
### Relational operators
|
### Relational operators
|
||||||
|
|
||||||
The following relational operators work on numbers and return a [Boolean](/reference/types/boolean):
|
The following relational operators work on numbers and return a [Boolean](/blocks/logic/boolean):
|
||||||
|
|
||||||
* equality: `(3 + 1) = 4`
|
* equality: `(3 + 1) = 4`
|
||||||
* inequality: `3 != 4`
|
* inequality: `3 != 4`
|
||||||
@ -67,5 +67,5 @@ basic.showNumber(abs);
|
|||||||
|
|
||||||
### See also
|
### See also
|
||||||
|
|
||||||
[math](/blocks/math), [var](/blocks/variables/var), [Boolean](/reference/types/boolean), [show number](/reference/basic/show-number)
|
[math](/blocks/math), [var](/blocks/variables/var), [Boolean](/blocks/logic/boolean), [show number](/reference/basic/show-number)
|
||||||
|
|
||||||
|
3
docs/reference/types/string-functions.md
Normal file
3
docs/reference/types/string-functions.md
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
## String functions
|
||||||
|
|
||||||
|
TBD
|
Loading…
Reference in New Issue
Block a user