2016-03-26 00:47:20 +01:00
|
|
|
# smiley blocks lesson
|
|
|
|
|
|
|
|
design a blinking image lesson #docs
|
|
|
|
|
|
|
|
### @video td/videos/smiley-0
|
|
|
|
|
|
|
|
## Topic
|
|
|
|
|
|
|
|
Show LEDs
|
|
|
|
|
|
|
|
## Quick Links
|
|
|
|
|
|
|
|
* [activity](/microbit/lessons/smiley/activity)
|
|
|
|
* [quiz](/microbit/lessons/smiley/quiz)
|
|
|
|
* [quiz answers](/microbit/lessons/smiley/quiz-answers)
|
|
|
|
* [challenges](/microbit/lessons/smiley/challenges)
|
|
|
|
|
2016-03-30 01:17:34 +02:00
|
|
|
## Prior learning/place of lesson in scheme of work
|
2016-03-26 00:47:20 +01:00
|
|
|
|
|
|
|
Learn how to **show LEDs** to turn on a LED light pattern on the LED screen. We will be learning basic comments such as show LEDs and pause.
|
|
|
|
|
|
|
|
## Documentation
|
|
|
|
|
|
|
|
* **show LEDs** : [read more...](/microbit/reference/basic/show-leds)
|
|
|
|
* **on button pressed** : [read more...](/microbit/reference/input/on-button-pressed)
|
|
|
|
|
2016-03-30 01:17:34 +02:00
|
|
|
```docs
|
|
|
|
input.onButtonPressed(Button.A, () => {
|
2016-03-26 00:47:20 +01:00
|
|
|
|
2016-03-30 01:17:34 +02:00
|
|
|
})
|
|
|
|
basic.showLeds(`
|
|
|
|
. . . . .
|
|
|
|
. . . . .
|
|
|
|
. . # . .
|
|
|
|
. . . . .
|
|
|
|
. . . . .
|
|
|
|
`)
|
2016-03-26 00:47:20 +01:00
|
|
|
|
2016-03-30 01:17:34 +02:00
|
|
|
```
|
2016-03-26 00:47:20 +01:00
|
|
|
|
2016-03-30 01:17:34 +02:00
|
|
|
## Objectives
|
2016-03-26 00:47:20 +01:00
|
|
|
|
2016-03-30 01:17:34 +02:00
|
|
|
* learn how to show LEDs on the LED screen
|
|
|
|
* learn how to run code when an input button is pressed
|
2016-03-26 00:47:20 +01:00
|
|
|
|