pxt-calliope/docs/lessons/zoomer/quiz-answers.md

36 lines
944 B
Markdown
Raw Normal View History

2016-03-25 16:47:20 -07:00
# zoomer quiz answers
2016-11-01 17:44:37 -07:00
Measure the acceleration on the @boardname@ in the "z" direction.
2016-03-25 16:47:20 -07:00
2016-04-13 08:27:45 -07:00
This is the answer key for the [zoomer quiz](/lessons/zoomer/quiz).
2016-03-25 16:47:20 -07:00
## 1. What is 'acceleration'?
Acceleration is amount of force being applied to the @boardname@ in one of three specified directions.
2016-03-25 16:47:20 -07:00
## 2. Consider the following directions
Write the line of code to measure the acceleration and then store in it a variable.
<br/>
2016-03-30 15:11:05 -07:00
```blocks
2018-04-21 11:47:43 -07:00
let accX = input.acceleration(Dimension.X)
2016-03-25 16:47:20 -07:00
```
Note: acceleration does not have be measured in the "x" direction. It can also be in the "y" or "z" direction.
## 3. Consider the following directions
After storing the acceleration in a variable, write the code to show acceleration on the @boardname@ as a number
2016-03-25 16:47:20 -07:00
<br/>
2016-03-30 15:11:05 -07:00
```blocks
2018-04-21 11:47:43 -07:00
let accX = input.acceleration(Dimension.X)
2016-03-30 15:11:05 -07:00
basic.showNumber(accX, 150)
2016-03-25 16:47:20 -07:00
```
Note: make sure the same variable name ("acc x" in this case) is the same in both lines of code..