Rewrote in simpler language
This commit is contained in:
parent
caeef2f1e1
commit
4e54649ce7
@ -1,35 +1,36 @@
|
|||||||
# Unplot
|
# Unplot
|
||||||
|
|
||||||
Turn off a LED light on the [LED screen](/device/screen). Specify which LED using x, y coordinates. Use [plot](/reference/led/plot) to turn a LED on.
|
Turn off the LED light you say on the [LED screen](/device/screen).
|
||||||
|
|
||||||
```sig
|
```sig
|
||||||
led.unplot(0,0)
|
led.unplot(0,0)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## ~hint
|
||||||
|
|
||||||
|
Use [plot](/reference/led/plot) to turn **on** an LED.
|
||||||
|
|
||||||
|
## ~
|
||||||
|
|
||||||
### Parameters
|
### Parameters
|
||||||
|
|
||||||
* x - [Number](/reference/types/number); the *x coordinate* or horizontal position (0, 1, 2, 3, 4)
|
* **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 - [Number](/reference/types/number); the *y coordinate* or vertical position (0, 1, 2, 3, 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)
|
||||||
|
|
||||||
If a parameter is [out of bounds](/reference/out-of-bounds) (a value other than 0-4), this function will do nothing.
|
If a parameter is [out of bounds](/reference/out-of-bounds) (a value
|
||||||
|
other than 0 to 4), then this function will do nothing.
|
||||||
|
|
||||||
### x, y coordinates?
|
### ~hint
|
||||||
|
|
||||||
The LED screen is made up of 25 LEDs arranged in a 5x5 grid. To figure out the ``x``, ``y`` coordinates, see [LED screen](/device/screen).
|
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).
|
||||||
|
|
||||||
This code turns off centre LED:
|
### ~
|
||||||
|
|
||||||
```blocks
|
### Example: Center off
|
||||||
led.unplot(2, 2)
|
|
||||||
```
|
|
||||||
|
|
||||||
### Get the LED on/off state
|
This program shows a picture on the LED screen, and then turns off the center LED with `unplot`.
|
||||||
|
|
||||||
Use the [point](/reference/led/point) function to find out if a LED is on or off.
|
|
||||||
|
|
||||||
### Example: toggle off
|
|
||||||
|
|
||||||
This code creates and shows an image on the micro:bit screen, and then clears the centre LED using `unplot`:
|
|
||||||
|
|
||||||
```blocks
|
```blocks
|
||||||
basic.showLeds(`
|
basic.showLeds(`
|
||||||
@ -43,7 +44,14 @@ basic.pause(500)
|
|||||||
led.unplot(2, 2)
|
led.unplot(2, 2)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### ~hint
|
||||||
|
|
||||||
|
Use the [point](/reference/led/point) function to find out if an LED is
|
||||||
|
on or off.
|
||||||
|
|
||||||
|
### ~
|
||||||
|
|
||||||
|
|
||||||
### See also
|
### See also
|
||||||
|
|
||||||
[plot](/reference/led/plot), [point](/reference/led/point), [LED screen](/device/screen), [create image](/reference/images/create-image)
|
[plot](/reference/led/plot), [point](/reference/led/point), [LED screen](/device/screen)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user