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(`
|
|
|
|
. . . . .
|
|
|
|
. # . # .
|
|
|
|
. . # . .
|
|
|
|
# . . . #
|
|
|
|
. # # # .
|
|
|
|
`
|
|
|
|
)
|
|
|
|
```
|
|
|
|
|
2019-12-02 05:58:26 +01:00
|
|
|
## Parameters
|
2016-03-26 00:47:20 +01:00
|
|
|
|
2019-12-02 05:58:26 +01:00
|
|
|
* `leds` is a [string](/types/string) that controls which LEDs are on and off.
|
|
|
|
* `interval` is an optional [number](/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
|
|
|
|
2019-12-02 05:58:26 +01:00
|
|
|
## ~ hint
|
|
|
|
|
|
|
|
See how the @boardname@ shows numbers, text, and displays images by watching this video about [LEDs](https://www.youtube.com/watch?v=qqBmvHD5bCw).
|
|
|
|
|
|
|
|
## ~
|
|
|
|
|
|
|
|
## 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(`
|
|
|
|
# # . # #
|
|
|
|
# # . # #
|
|
|
|
. # # # .
|
|
|
|
. # . # .
|
|
|
|
. # . # .
|
|
|
|
`
|
|
|
|
)
|
|
|
|
```
|
|
|
|
|
2019-12-02 05:58:26 +01:00
|
|
|
## ~hint
|
2016-06-13 23:15:39 +02:00
|
|
|
|
|
|
|
If you are programming in JavaScript, `#` means an LED that is turned
|
|
|
|
on and `.` means an LED that is turned off.
|
|
|
|
|
2019-12-02 05:58:26 +01:00
|
|
|
## ~
|
2016-03-26 00:47:20 +01:00
|
|
|
|
2019-12-02 05:58:26 +01:00
|
|
|
## See also
|
2016-03-26 00:47:20 +01:00
|
|
|
|
2019-12-02 05:58:26 +01:00
|
|
|
[plot leds](/reference/basic/plot-leds), [show animation](/reference/basic/show-animation)
|
2016-03-26 00:47:20 +01:00
|
|
|
|