pxt-calliope/docs/lessons/looper.md

43 lines
973 B
Markdown
Raw Normal View History

2016-03-26 00:47:20 +01:00
# looper blocks lesson
2016-04-02 01:22:47 +02:00
Learn to control blinking LEDs.
2016-03-26 00:47:20 +01:00
### @video td/videos/looper-0
## Topic
For Loop
## Quick links
* [activity](/microbit/lessons/looper/activity)
* [challenges](/microbit/lessons/looper/challenges)
2016-03-31 00:54:19 +02:00
* [quiz](/microbit/lessons/looper/quiz)
* [quiz answers](/microbit/lessons/looper/quiz-answers)
2016-03-26 00:47:20 +01:00
## Class
Year 7
## Prior learning/place of lesson in scheme of work
Learn how to control a blinking LED. We will be learning how to create a blinking app using the for loop as well as simple commands, such as plot and pause.
## Documentation
2016-04-05 07:33:13 +02:00
```cards
for (let i = 0; i < 5; i++) {}
2016-03-30 00:59:00 +02:00
basic.showNumber(0)
basic.pause(100)
```
2016-03-26 00:47:20 +01:00
## Objectives
* learn how to repeat code a fixed number of times
* learn how to show a number on the LED screen, one digit at a time (scrolling from left to right)
* learn how to pause program execution for the specified number of milliseconds
* learn how to arithmetic operators operate on numbers and return a number