Documentation snippet fixes
This commit is contained in:
parent
4430391e87
commit
41a4dfeb68
@ -49,15 +49,13 @@ The micro:bit’s *scheduler* provides the capability to concurrently execute di
|
|||||||
The first job of the scheduler is to allow multiple *subprograms* to be queued up for later execution . For our purposes, a subprogram is just a statement or sequence of statements in the context of a larger program. Consider the Touch Develop program below for counting button presses.
|
The first job of the scheduler is to allow multiple *subprograms* to be queued up for later execution . For our purposes, a subprogram is just a statement or sequence of statements in the context of a larger program. Consider the Touch Develop program below for counting button presses.
|
||||||
|
|
||||||
```blocks
|
```blocks
|
||||||
export function countButtonPresses() {
|
|
||||||
let count = 0
|
|
||||||
input.onButtonPressed(Button.A, () => {
|
input.onButtonPressed(Button.A, () => {
|
||||||
count = count + 1
|
count = count + 1
|
||||||
})
|
})
|
||||||
basic.forever(() => {
|
basic.forever(() => {
|
||||||
basic.showNumber(count, 150)
|
basic.showNumber(count, 150)
|
||||||
})
|
})
|
||||||
}
|
let count = 0
|
||||||
```
|
```
|
||||||
|
|
||||||
The program above contains three statements that execute in order from top to bottom. The first statement
|
The program above contains three statements that execute in order from top to bottom. The first statement
|
||||||
|
@ -49,7 +49,7 @@ basic.clearScreen()
|
|||||||
|
|
||||||
It's a syntax error to have a left parenthesis without the "closing" right parenthesis:
|
It's a syntax error to have a left parenthesis without the "closing" right parenthesis:
|
||||||
|
|
||||||
```typescript
|
```
|
||||||
basic.clearScreen(
|
basic.clearScreen(
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ Reading and writing data over a serial connection.
|
|||||||
```cards
|
```cards
|
||||||
serial.writeLine("");
|
serial.writeLine("");
|
||||||
serial.writeNumber(0);
|
serial.writeNumber(0);
|
||||||
serial.writeValue(x, 0);
|
serial.writeValue("x", 0);
|
||||||
serial.writeString("");
|
serial.writeString("");
|
||||||
serial.readLine();
|
serial.readLine();
|
||||||
serial.redirect(SerialPin.P0, SerialPin.P0, BaudRate.BaudRate115200);
|
serial.redirect(SerialPin.P0, SerialPin.P0, BaudRate.BaudRate115200);
|
||||||
|
Loading…
Reference in New Issue
Block a user