charting lesson

This commit is contained in:
Michael Elliot Braun
2016-03-31 17:17:22 -07:00
parent 34c5a5e216
commit 691da3605f
3 changed files with 6 additions and 6 deletions

View File

@ -13,14 +13,14 @@ Welcome! This activity will teach how to use the 1st micro:bit to chart the seco
Let's measure `acceleration (mg)` and then `send number`. `Acceleration` is measured in **milli-gravities**, so a value of -1000 is equivalent to -1g or -9.81m/s^2. We will be able to get the acceleration value (g-force), in the specified "x" dimension. `Send number` will broadcast a number data packet to other micro:bits connected via radio.
```blocks
radio.sendNumber(input.acceleration(Dimension.X))
radio.sendNumber(input.acceleration(Dimension.X));
```
We want to display the acceleration forever. In order to do so, we need a `forever` loop. A forever loop will repeat code in the background forever.
```blocks
basic.forever(() => {
radio.sendNumber(input.acceleration(Dimension.X))
radio.sendNumber(input.acceleration(Dimension.X));
})
```