pxt-calliope/docs/lessons/zoomer.md

45 lines
1.3 KiB
Markdown
Raw Normal View History

2016-03-26 00:47:20 +01:00
# zoomer blocks lesson
measure the acceleration on the micro:bit in the "z" direction #acceleration #var #docs #if #show
### @video td/videos/zoomer-0
## Topic
Acceleration
## Quick Links
* [activity](/microbit/lessons/zoomer/activity)
* [challenges](/microbit/lessons/zoomer/challenges)
2016-03-31 01:10:27 +02:00
* [quiz](/microbit/lessons/zoomer/quiz)
* [quiz answers](/microbit/lessons/zoomer/quiz-answers)
2016-03-26 00:47:20 +01:00
## Prior learning/place of lesson in scheme of work
Learn how to get the **acceleration**, `acceleration` in one of three specified dimensions. We will be learning how to get the acceleration using a forever loop, local variables, input on button pressed, as well as simple commands, such as show number and pause.
## Documentation
2016-03-30 01:17:34 +02:00
```docs
basic.forever(() => {
})
let x = 0
input.acceleration(Dimension.X)
if (true) {
}
input.buttonIsPressed(Button.A)
basic.showNumber(0)
```
2016-03-26 00:47:20 +01:00
## Objectives
* learn how to repeat code in the background forever
* learn how to create a variable to store data
* learn how to get the acceleration value (g-force), in one of three specified dimensions
* learn how to pause your code for the specified number of milliseconds
* learn how to conditionally run code depending on whether a condition is true or not
* learn how to get the state of an input button
* learn how to show a number on the LED screen