pxt-calliope/docs/lessons/night-light.md
Michael Elliot Braun a14585d36f updating lessons
2016-03-30 15:54:19 -07:00

45 lines
1013 B
Markdown

# night light lesson
change the brightness of the BBC micro:bit #brightness #plot #docs
### @video td/videos/night-light-0
## Topic
Set Brightness
## Quick Links
* [activity](/microbit/lessons/night-light/activity)
* [challenges](/microbit/lessons/night-light/challenges)
* [quiz](/microbit/lessons/night-light/quiz)
* [quiz answers](/microbit/lessons/night-light/quiz-answers)
## Prior learning/place of lesson in scheme of work
Learn how to **set brightness** of an image `set brightness` to set the brightness of the LED screen. We will be learning how to set the brightness of the LED screen using LED show LEDs, on button pressed and set brightness.
## Documentation
```docs
led.setBrightness(255)
input.onButtonPressed(Button.A, () => {
})
basic.showLeds(`
. . . . .
. . . . .
. . # . .
. . . . .
. . . . .
`)
```
## Objectives
* learn how to set the brightness of the LED screen
* learn how to run code when an input button is pressed
* learn how to turn on all LEDs