move lessons out of web site

will move select lessons back to "educators" section
This commit is contained in:
Tom Ball
2016-06-14 11:49:58 -04:00
parent a6e6dd8287
commit f4eca66648
184 changed files with 8 additions and 8 deletions

View File

@ -0,0 +1,43 @@
# zoomer block activity
Measure the acceleration on the micro:bit in the "z" direction.
### ~avatar avatar
### ~
Welcome! This activity will teach how to measure the acceleration on the micro:bit in the "z" direction. Let's get started!
We want to display the acceleration forever. In order to do so, we need a `forever` loop.
```blocks
basic.forever(() => {
})
```
Let's measure the acceleration and then store in it a variable `az`. The acceleration is measured in **milli-gravities**, so a value of `-1000` is equivalent to `-1g` or `-9.81m/s^2`.
```blocks
basic.forever(() => {
let az = input.acceleration(Dimension.Z)
})
```
Show the value of `az` on the screen.
```blocks
basic.forever(() => {
let az = input.acceleration(Dimension.Z)
basic.showNumber(az)
})
```
### ~avatar avatar
Excellent, you're ready to continue with the [challenges](/lessons/zoomer/challenges)!
### ~

View File

@ -0,0 +1,37 @@
# zoomer blocks challenges
Coding challenges for zoomer.
## Before we get started
Complete the following [activity](/lessons/zoomer/activity) and your finished code should look like this:
```blocks
basic.forever(() => {
let az = input.acceleration(Dimension.Z)
basic.showNumber(az)
})
```
### Challenge 1
We'll modify the code to display the `x` acceleration if the `A` button is pressed. For that, we need to store `acceleration (x)` in a new variable `ax` and use a `button (A) is pressed` to detect if the button is pressed.
```blocks
basic.forever(() => {
let az = input.acceleration(Dimension.Z)
let ax = input.acceleration(Dimension.X)
if (input.buttonIsPressed(Button.A)) {
basic.showNumber(ax)
}
basic.showNumber(az)
})
```
* Run the code to see if it works as expected.
### Challenge 2
Display the `y` acceleration when `B` is pressed by adding another `if` statement using `button (B) is pressed`.

View File

@ -0,0 +1,35 @@
# zoomer quiz answers
Measure the acceleration on the micro:bit in the "z" direction.
This is the answer key for the [zoomer quiz](/lessons/zoomer/quiz).
## 1. What is 'acceleration'?
Acceleration is amount of force being applied to the BBC micro:bit in one of three specified directions.
## 2. Consider the following directions
Write the line of code to measure the acceleration and then store in it a variable.
<br/>
```blocks
let accX_ = input.acceleration("x")
```
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 BBC micro:bit as a number
<br/>
```blocks
let accX = input.acceleration("x")
basic.showNumber(accX, 150)
```
Note: make sure the same variable name ("acc x" in this case) is the same in both lines of code..

View File

@ -0,0 +1,24 @@
# zoomer quiz
Measure the acceleration on the micro:bit in the "z" direction.
## Name
## Directions
Use this activity document to guide your work in the [zoomer tutorial](/lessons/zoomer/activity)
Answer the questions while completing the tutorial. Pay attention to the dialogues!
## 1. What is 'acceleration'?
<br/>
## 2. Write the line of code to measure the acceleration and then store in it a variable.
<br/>
## 3. After storing the acceleration in a variable, write the code to show acceleration on the BBC micro:bit as a number.
<br/>