move lessons out of web site
will move select lessons back to "educators" section
This commit is contained in:
@ -1,23 +0,0 @@
|
||||
# answering machine blocks activity
|
||||
|
||||
Learn to create an answering machine on the micro:bit
|
||||
|
||||
### ~avatar avatar
|
||||
|
||||
|
||||
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](/lessons/answering-machine/challenges)!
|
||||
|
||||
### ~
|
||||
|
@ -1,45 +0,0 @@
|
||||
# answering machine blocks challenges
|
||||
|
||||
Coding challenges for the answering machine tutorial.
|
||||
|
||||
## Before we get started
|
||||
|
||||
Complete the [answering machine](/lessons/answering-machine/activity) activity and your code will look like this:
|
||||
|
||||
```blocks
|
||||
basic.showString("ASK ME A QUESTION")
|
||||
```
|
||||
|
||||
### Challenge 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
|
||||
|
||||
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`.
|
@ -1,38 +0,0 @@
|
||||
# answering machine blocks quiz answers
|
||||
|
||||
Create an answering machine on the micro:bit.
|
||||
|
||||
This is the answer key for the [answering machine quiz](/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
|
||||
|
||||
```blocks
|
||||
basic.showString("Y")
|
||||
```
|
||||
|
||||

|
||||
|
||||
## 3. Draw which LED is ON after running this code
|
||||
|
||||
|
||||
```blocks
|
||||
basic.showString("Hi")
|
||||
```
|
||||
|
||||

|
||||
|
||||
|
||||
## 4. If the rectangle below represents the micro:bit, write the code to display the letter "Z".
|
||||
|
||||

|
||||
|
||||
|
||||
```blocks
|
||||
basic.showString("Z")
|
||||
```
|
||||
|
||||
|
@ -1,46 +0,0 @@
|
||||
# answering machine blocks quiz
|
||||
|
||||
Create an answering machine on the micro:bit.
|
||||
|
||||
## Name
|
||||
|
||||
## Directions
|
||||
|
||||
Use this activity document to guide your work in the [answering machine activity](/lessons/answering-machine/activity).
|
||||
|
||||
Answer the questions while completing the activity. Pay attention to the dialogues!
|
||||
|
||||
## 1. Define what `show string` does?
|
||||
|
||||
|
||||
|
||||
## 2. Draw which LED is ON after running this code
|
||||
|
||||
|
||||
```blocks
|
||||
basic.showString("Y")
|
||||
|
||||
```
|
||||
|
||||

|
||||
|
||||
|
||||
## 3. Draw which LED is ON after running this code
|
||||
|
||||
|
||||
```blocks
|
||||
basic.showString("Hi")
|
||||
|
||||
```
|
||||
|
||||
|
||||

|
||||
|
||||
## 4. If the rectangle below represents the micro:bit, write the code to display the letter "Z".
|
||||
|
||||
```blocks
|
||||
basic.showString("Z")
|
||||
|
||||
```
|
||||
|
||||
|
Reference in New Issue
Block a user