pxt-calliope/docs/lessons/magic-logo/quiz-answers.md

57 lines
1022 B
Markdown
Raw Normal View History

2016-03-26 00:47:20 +01:00
# magic logo quiz answers
2016-04-02 01:22:47 +02:00
show an image that points up when the logo is up.
2016-03-26 00:47:20 +01:00
## Name
## Directions
This is the answer key for the [magic logo quiz](/microbit/lessons/magic-logo/quiz)
Answer the questions while completing the tutorial. Pay attention to the dialogues!
## 1. Define 'on logo up'
A function that will run code when the BBC micro:bit screen is facing up and vertically orientated.
<br/>
2016-03-30 22:41:01 +02:00
## 2. Write the condition that detects when the BBC micro:bit logo is facing up and vertically orientated.
The `logo up` event is raised when...
* the screen is facing up and the board is horizontal
* the screen is facing down and the board is horizontal
* the board is vertical and the logo is facing up
2016-03-26 00:47:20 +01:00
<br/>
2016-03-30 22:41:01 +02:00
```blocks
2016-03-26 00:47:20 +01:00
input.onLogoUp(() => {
})
```
<br/>
2016-03-30 22:41:01 +02:00
## 3. Write the code to display a downward pointing arrow when the logo is down.
2016-03-26 00:47:20 +01:00
![](/static/mb/lessons/magic-logo-0.png)
2016-03-30 22:41:01 +02:00
2016-03-26 00:47:20 +01:00
<br/>
2016-03-30 22:41:01 +02:00
```blocks
2016-03-26 00:47:20 +01:00
input.onLogoDown(() => {
2016-03-31 00:11:05 +02:00
basic.showLeds(`
2016-03-26 00:47:20 +01:00
. . # . .
. . # . .
# # # # #
. # # # .
. . # . .
`)
})
```