pxt-calliope/docs/reference/led/unplot.md

61 lines
1.2 KiB
Markdown
Raw Normal View History

2016-03-26 00:47:20 +01:00
# Unplot
2016-06-13 22:39:05 +02:00
Turn off the LED light you say on the [LED screen](/device/screen).
2016-03-26 00:47:20 +01:00
```sig
led.unplot(0,0)
```
2016-06-13 22:39:05 +02:00
## ~hint
2016-03-26 00:47:20 +01:00
2016-06-13 22:39:05 +02:00
Use [plot](/reference/led/plot) to turn **on** an LED.
2016-03-26 00:47:20 +01:00
2016-06-13 22:39:05 +02:00
## ~
2016-03-26 00:47:20 +01:00
2016-06-13 22:39:05 +02:00
### Parameters
2016-03-26 00:47:20 +01:00
2016-07-18 20:14:51 +02:00
* ``x`` is a [number](/reference/types/number) that means the
horizontal spot on the LED screen (from left to right: 0, 1, 2, 3,
or 4)
* ``y`` is a [number](/reference/types/number) that means the vertical
spot on the LED screen (from top to bottom: 0, 1, 2, 3, or 4)
2016-03-26 00:47:20 +01:00
2016-06-13 22:39:05 +02:00
If a parameter is [out of bounds](/reference/out-of-bounds) (a value
other than 0 to 4), then this function will do nothing.
2016-03-26 00:47:20 +01:00
2016-06-13 22:39:05 +02:00
### ~hint
2016-03-26 00:47:20 +01:00
2016-06-13 22:39:05 +02:00
The LED screen is a solid square of LEDs with five LEDs on each side.
To learn more about how you number the LEDs with ``x`` and ``y``
coordinates, see [LED screen](/device/screen).
2016-03-26 00:47:20 +01:00
2016-06-13 22:39:05 +02:00
### ~
2016-03-26 00:47:20 +01:00
2016-06-13 22:39:05 +02:00
### Example: Center off
2016-03-26 00:47:20 +01:00
2016-06-13 22:39:05 +02:00
This program shows a picture on the LED screen, and then turns off the center LED with `unplot`.
2016-03-26 00:47:20 +01:00
```blocks
basic.showLeds(`
. . # . .
. . # . .
# # # # #
. . # . .
. . # . .
`)
basic.pause(500)
led.unplot(2, 2)
```
2016-06-13 22:39:05 +02:00
### ~hint
Use the [point](/reference/led/point) function to find out if an LED is
on or off.
### ~
2016-03-26 00:47:20 +01:00
2016-06-13 22:39:05 +02:00
### See also
[plot](/reference/led/plot), [point](/reference/led/point), [LED screen](/device/screen)