put lessons back for Michael
This commit is contained in:
58
docs/lessons/night-light/quiz-answers.md
Normal file
58
docs/lessons/night-light/quiz-answers.md
Normal file
@ -0,0 +1,58 @@
|
||||
# night light quiz answers
|
||||
|
||||
Answers to the night light quiz.
|
||||
|
||||
This is the answer key for the [night light quiz](/lessons/night-light/quiz).
|
||||
|
||||
## 1. Define the function "set brightness"
|
||||
|
||||
This function sets the brightness of the LED screen.
|
||||
|
||||
## 2. Consider the following image
|
||||
|
||||

|
||||
|
||||
If the rectangle above represents the BBC micro:bit, write the code to set all the LEDs to full brightness and to turn on all the LEDs.
|
||||
|
||||
<br />
|
||||
|
||||
```blocks
|
||||
led.setBrightness(255)
|
||||
basic.showLeds(`
|
||||
# # # # #
|
||||
# # # # #
|
||||
# # # # #
|
||||
# # # # #
|
||||
# # # # #
|
||||
`)
|
||||
```
|
||||
|
||||
## 3. Consider the following image
|
||||
|
||||

|
||||
|
||||
If the rectangle above represents the BBC micro:bit, write the code to set the screen brightness to 50% (128) and turns on all the LEDs.
|
||||
|
||||
<br/>
|
||||
|
||||
```blocks
|
||||
led.setBrightness(128)
|
||||
basic.showLeds(`
|
||||
# # # # #
|
||||
# # # # #
|
||||
# # # # #
|
||||
# # # # #
|
||||
# # # # #
|
||||
`)
|
||||
```
|
||||
|
||||
## 4. Consider the following image
|
||||
|
||||

|
||||
|
||||
If the rectangle above represents the BBC micro:bit, write the code to turn off all the LEDs.
|
||||
|
||||
```blocks
|
||||
led.setBrightness(0)
|
||||
```
|
||||
|
Reference in New Issue
Block a user