pxt-calliope/docs/blocks/loops/for.md
Sam El-Husseini e3975e65e5 pxt-microbit Accessibility PR ()
* Accessibility changes
2017-09-07 13:42:08 -07:00

265 B

@extends

#examples

Example: Count to 4

This program will show the numbers 0, 1, 2, 3, and 4 one after another on the LED screen.

input.onButtonPressed(Button.A, () => {
    for(let i = 0; i < 5; ++i) {
        basic.showNumber(i)
    }
})