pxt-calliope/docs/reference/basic/show-leds.md

48 lines
906 B
Markdown
Raw Normal View History

2016-03-26 00:47:20 +01:00
# Show LEDs
2016-06-13 23:15:39 +02:00
Shows a picture on the [LED screen](/device/screen).
2016-03-26 00:47:20 +01:00
```sig
basic.showLeds(`
. . . . .
. # . # .
. . # . .
# . . . #
. # # # .
`
)
```
### Parameters
2016-06-14 16:31:16 +02:00
* `leds` is a [string](/reference/types/string) that controls which LEDs are on and off.
2016-06-13 23:15:39 +02:00
* `interval` is an optional [number](/reference/types/number) that means how many milliseconds to wait after showing a picture.
2016-06-14 16:31:16 +02:00
If you are programming with blocks, `interval` is set at 400 milliseconds.
2016-03-26 00:47:20 +01:00
### Example
2016-03-26 00:47:20 +01:00
2016-06-13 23:15:39 +02:00
This program shows a picture with the ``show leds`` function.
2016-03-26 00:47:20 +01:00
```blocks
basic.showLeds(`
# # . # #
# # . # #
. # # # .
. # . # .
. # . # .
`
)
```
2016-06-13 23:15:39 +02:00
### ~hint
If you are programming in JavaScript, `#` means an LED that is turned
on and `.` means an LED that is turned off.
### ~
2016-03-26 00:47:20 +01:00
### See also
2016-04-16 01:15:08 +02:00
[plot leds](/reference/led/plot-leds), [show animation](/reference/basic/show-animation)
2016-03-26 00:47:20 +01:00