pxt-calliope/docs/lessons/night-light.md

40 lines
914 B
Markdown
Raw Normal View History

2016-03-25 16:47:20 -07:00
# night light lesson
change the brightness of the @boardname@.
2016-03-25 16:47:20 -07:00
## Topic
Set Brightness
## Quick Links
2016-04-13 08:27:45 -07:00
* [activity](/lessons/night-light/activity)
* [challenges](/lessons/night-light/challenges)
* [quiz](/lessons/night-light/quiz)
* [quiz answers](/lessons/night-light/quiz-answers)
2016-03-25 16:47:20 -07:00
## 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
2016-04-04 22:33:13 -07:00
```cards
2016-03-29 16:17:34 -07:00
led.setBrightness(255)
2016-04-04 22:33:13 -07:00
input.onButtonPressed(Button.A, () => {})
2016-03-29 16:17:34 -07:00
basic.showLeds(`
. . . . .
. . . . .
. . # . .
. . . . .
. . . . .
`)
```
2016-03-25 16:47:20 -07:00
## 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