Fix some doc issues
This commit is contained in:
parent
918972ba6f
commit
8719f557aa
@ -108,7 +108,6 @@ In the ``||radio:on radio received||`` event, the temperature is received from s
|
||||
let temperature = 0
|
||||
basic.showString("TEMPERATURE RADIO RECEIVER")
|
||||
radio.setGroup(99)
|
||||
let temperature = 0
|
||||
radio.onDataPacketReceived( ({ receivedNumber: temperature }) => {
|
||||
basic.showNumber(temperature)
|
||||
})
|
||||
|
@ -142,7 +142,7 @@ Through this example, we have seen that the micro:bit scheduler enables you to c
|
||||
As a result, you can easily add a new capability to the micro:bit by just adding a new subprogram. For example, if you want to add a reset feature to the counter program, all you need to do is add a new event handler for a press of button B that sets the global variable "count" to zero, as shown below:
|
||||
|
||||
```typescript
|
||||
export function countButtonPressesWithReset() {
|
||||
function countButtonPressesWithReset() {
|
||||
let count = 0
|
||||
input.onButtonPressed(Button.A, () => {
|
||||
count = count + 1
|
||||
|
@ -21,7 +21,7 @@ We are creating a forever loop to constantly display the appropriate brightness
|
||||
<br/>
|
||||
|
||||
```blocks
|
||||
let acceleration = input.acceleration("y")
|
||||
let acceleration = input.acceleration(Dimension.Y)
|
||||
```
|
||||
|
||||
## 3. After storing the acceleration in a variable, write the code to take the absolute value of the acceleration, and store this value inside 'acceleration'.
|
||||
|
@ -15,7 +15,7 @@ Write the line of code to measure the acceleration and then store in it a variab
|
||||
<br/>
|
||||
|
||||
```blocks
|
||||
let accX = input.acceleration("x")
|
||||
let accX = input.acceleration(Dimension.X)
|
||||
```
|
||||
|
||||
Note: acceleration does not have be measured in the "x" direction. It can also be in the "y" or "z" direction.
|
||||
@ -27,7 +27,7 @@ After storing the acceleration in a variable, write the code to show acceleratio
|
||||
<br/>
|
||||
|
||||
```blocks
|
||||
let accX = input.acceleration("x")
|
||||
let accX = input.acceleration(Dimension.X)
|
||||
basic.showNumber(accX, 150)
|
||||
```
|
||||
|
||||
|
@ -96,6 +96,7 @@ Thanks for playing with Karel the LED!
|
||||
Copy this code into the JavaScript editor and then download it to the board.
|
||||
|
||||
```typescript
|
||||
const board = new Board();
|
||||
/**
|
||||
* Karel the LED
|
||||
*/
|
||||
@ -132,7 +133,6 @@ function updateLeds() {
|
||||
}
|
||||
}
|
||||
}
|
||||
const board = new Board();
|
||||
enum Direction {
|
||||
UP = 0,
|
||||
LEFT,
|
||||
|
@ -84,4 +84,4 @@ The [radio-blockchain](https://makecode.microbit.org/pkg/microsoft/pxt-radio-blo
|
||||
```package
|
||||
radio
|
||||
radio-blockchain=github:Microsoft/pxt-radio-blockchain#master
|
||||
```
|
||||
```
|
||||
|
@ -15,7 +15,7 @@ pins.analogPitch(440, 300)
|
||||
## Example
|
||||
|
||||
```blocks
|
||||
pins.analogSetPitchPin("P0")
|
||||
pins.analogSetPitchPin(AnalogPin.P0);
|
||||
let frequency1 = 440
|
||||
let duration = 1000
|
||||
pins.analogSetPitchPin(AnalogPin.P1);
|
||||
|
Loading…
Reference in New Issue
Block a user