Migrate docs from the other repo

This commit is contained in:
Michal Moskal
2016-03-25 16:47:20 -07:00
parent 38d2cf06d2
commit a08eb53f92
895 changed files with 36888 additions and 0 deletions

View File

@ -0,0 +1,24 @@
# answering machine blocks activity
Learn to create an answering machine on the micro:bit
### ~avatar avatar
### @video td/videos/answering-machine-0
Let's learn how to create an answering machine!
### ~
We will use `show string` to show text on the LED screen. *String* is a common name for *text* in programming languages. The function `show string` scrolls the text column by column at a *150* milliseconds interval.
```blocks
basic.showString("ASK ME A QUESTION")
```
### ~avatar boothing
Excellent, you're ready to continue with the [challenges](/microbit/lessons/answering-machine/challenges)!
### ~

View File

@ -0,0 +1,51 @@
# answering machine blocks challenges
Coding challenges for the answering machine tutorial.
## Before we get started
Complete the [answering machine](/microbit/lessons/answering-machine/activity) activity and your code will look like this:
```blocks
basic.showString("ASK ME A QUESTION")
```
### Challenge 1
### @video td/videos/answering-machine-1
Now we need to reply after someone asks micro:bit a yes or no question. We want to respond `YES` when button `A` is pressed. Add a condition for button `A` and inside it show the string `YES`.
```blocks
basic.showString("ASK ME A QUESTION")
input.onButtonPressed(Button.A, () => {
basic.showString("Yes")
})
```
* `Run` the code to see if it works as expected.
### Challenge 2
### @video td/videos/answering-machine-2
What if micro:bit's answer to the question is no? Let's have `NO` be displayed when button `B` is pressed. Add a condition for button `B` and inside it show the string `NO`.
```blocks
basic.showString("ASK ME A QUESTION")
input.onButtonPressed(Button.A, () => {
basic.showString("Yes")
})
input.onButtonPressed(Button.B, () => {
basic.showString("NO")
})
```
* `Run` the code to see if it works as expected.
**Challenge 3**
When you are asked a yes or no question, do you always say yes or no? Add a condition for `on shake` that displays `MAYBE`.

View File

@ -0,0 +1,30 @@
# answering machine blocks quiz answers
Create an answering machine on the micro:bit. #LED #screen #show #math #docs #input
This is the answer key for the [answering machine quiz](/microbit/lessons/answering-machine/quiz).
## 1. Define what `show string` does?
Answers may vary. This is a function that will show a string on the LED screen one character at a time (scrolling from left to right).
## 2. Draw which LED is ON after running this code
![](/static/mb/blocks/lessons/answering-machine-3.png)
![](/static/mb/lessons/answering-machine-0.png)
## 3. Draw which LED is ON after running this code
![](/static/mb/blocks/lessons/answering-machine-4.png)
![](/static/mb/lessons/answering-machine-1.png)
<br/>
## 4. If the rectangle below represents the micro:bit, write the code to display the letter "Z".
![](/static/mb/lessons/answering-machine-2.png)
![](/static/mb/blocks/lessons/answering-machine-5.png)

View File

@ -0,0 +1,40 @@
# answering machine blocks quiz
Create an answering machine on the micro:bit. #LED #screen #show #math #docs #input
## Name
## Directions
Use this activity document to guide your work in the [answering machine activity](/microbit/lessons/answering-machine/activity).
Answer the questions while completing the activity. Pay attention to the dialogues!
## 1. Define what `show string` does?
<br/>
<br/>
## 2. Draw which LED is ON after running this code
![](/static/mb/blocks/lessons/answering-machine-3.png)
![](/static/mb/empty-microbit.png)
<br/>
## 3. Draw which LED is ON after running this code
![](/static/mb/blocks/lessons/answering-machine-4.png)
![](/static/mb/lessons/answering-machine-4.png)
<br/>
## 4. If the rectangle below represents the micro:bit, write the code to display the letter "Z".
![](/static/mb/lessons/answering-machine-5.png)
<br/>