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

36 lines
928 B
Markdown
Raw Normal View History

2016-03-26 00:47:20 +01:00
# zoomer quiz answers
2016-11-02 01:44:37 +01:00
Measure the acceleration on the @boardname@ in the "z" direction.
2016-03-26 00:47:20 +01:00
2016-04-13 17:27:45 +02:00
This is the answer key for the [zoomer quiz](/lessons/zoomer/quiz).
2016-03-26 00:47:20 +01:00
## 1. What is 'acceleration'?
Acceleration is amount of force being applied to the @boardname@ in one of three specified directions.
2016-03-26 00:47:20 +01: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-31 00:11:05 +02:00
```blocks
2016-07-19 12:42:42 +02:00
let accX = input.acceleration("x")
2016-03-26 00:47:20 +01: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-26 00:47:20 +01:00
<br/>
2016-03-31 00:11:05 +02:00
```blocks
2016-03-26 00:47:20 +01:00
let accX = input.acceleration("x")
2016-03-31 00:11:05 +02:00
basic.showNumber(accX, 150)
2016-03-26 00:47:20 +01:00
```
Note: make sure the same variable name ("acc x" in this case) is the same in both lines of code..