updated docs on plotBrightness (#509)
This commit is contained in:
parent
7dfaf2f772
commit
3180229bce
@ -8,6 +8,7 @@ led.unplot(0, 0);
|
|||||||
led.point(0, 0);
|
led.point(0, 0);
|
||||||
led.toggle(0, 0);
|
led.toggle(0, 0);
|
||||||
led.brightness();
|
led.brightness();
|
||||||
|
led.plotBrightness(0, 0, 255)
|
||||||
led.setBrightness(255);
|
led.setBrightness(255);
|
||||||
led.stopAnimation();
|
led.stopAnimation();
|
||||||
led.plotBarGraph(0, 0);
|
led.plotBarGraph(0, 0);
|
||||||
@ -23,4 +24,4 @@ led.enable(false)
|
|||||||
### See Also
|
### See Also
|
||||||
|
|
||||||
[plot](/reference/led/plot), [unplot](/reference/led/unplot), [point](/reference/led/point), [brightness](/reference/led/brightness), [setBrightness](/reference/led/set-brightness), [stopAnimation](/reference/led/stop-animation), [plotBarGraph](/reference/led/plot-bar-graph), [fadeIn](/reference/led/fade-in), [fadeOut](/reference/led/fade-out), [plotAll](/reference/led/plot-all), [screenshot](/reference/led/screenshot), [toggle](/reference/led/toggle), [toggleAll](/reference/led/toggle-all), [setDisplayMode](/reference/led/set-display-mode), [enabled](/reference/led/enable),
|
[plot](/reference/led/plot), [unplot](/reference/led/unplot), [point](/reference/led/point), [brightness](/reference/led/brightness), [setBrightness](/reference/led/set-brightness), [stopAnimation](/reference/led/stop-animation), [plotBarGraph](/reference/led/plot-bar-graph), [fadeIn](/reference/led/fade-in), [fadeOut](/reference/led/fade-out), [plotAll](/reference/led/plot-all), [screenshot](/reference/led/screenshot), [toggle](/reference/led/toggle), [toggleAll](/reference/led/toggle-all), [setDisplayMode](/reference/led/set-display-mode), [enabled](/reference/led/enable),
|
||||||
[plotBrightness](/reference/led/plotBrightness),
|
[plotBrightness](/reference/led/plot-brightness),
|
||||||
|
@ -6,12 +6,6 @@ Turn on a LED light with a specific brightness on the [LED screen](/device/scree
|
|||||||
led.plotBrightness(0,0, 128);
|
led.plotBrightness(0,0, 128);
|
||||||
```
|
```
|
||||||
|
|
||||||
## ~hint
|
|
||||||
|
|
||||||
Use [unplot](/reference/led/unplot) to turn **off** an LED.
|
|
||||||
|
|
||||||
## ~
|
|
||||||
|
|
||||||
### Parameters
|
### Parameters
|
||||||
|
|
||||||
* ``x`` is a [number](/types/number) that means the
|
* ``x`` is a [number](/types/number) that means the
|
||||||
@ -37,7 +31,7 @@ coordinates, see [LED screen](/device/screen).
|
|||||||
This program turns on the bottom right LED at 50% brightness
|
This program turns on the bottom right LED at 50% brightness
|
||||||
|
|
||||||
```blocks
|
```blocks
|
||||||
led.plot(4, 4, 128)
|
led.plotBrightness(2, 2, 128)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -49,10 +43,10 @@ to make a square around the edges of the LED screen.
|
|||||||
|
|
||||||
```blocks
|
```blocks
|
||||||
for (let i = 0; i < 5; i++) {
|
for (let i = 0; i < 5; i++) {
|
||||||
led.plot(0, i, 64)
|
led.plotBrightness(0, i, 64)
|
||||||
led.plot(4, i, 128)
|
led.plotBrightness(4, i, 128)
|
||||||
led.plot(i, 0, 172)
|
led.plotBrightness(i, 0, 172)
|
||||||
led.plot(i, 4, 255)
|
led.plotBrightness(i, 4, 255)
|
||||||
basic.pause(500)
|
basic.pause(500)
|
||||||
}
|
}
|
||||||
```
|
```
|
@ -30,7 +30,7 @@ namespace led {
|
|||||||
* @param y the vertical coordinate of the LED starting at 0
|
* @param y the vertical coordinate of the LED starting at 0
|
||||||
* @param brightness the brightness from 0 (off) to 255 (bright), eg:255
|
* @param brightness the brightness from 0 (off) to 255 (bright), eg:255
|
||||||
*/
|
*/
|
||||||
//% help=led/plot weight=78
|
//% help=led/plot-brightness weight=78
|
||||||
//% blockId=device_plot_brightness block="plot|x %x|y %y|brightness %brightness" blockGap=8
|
//% blockId=device_plot_brightness block="plot|x %x|y %y|brightness %brightness" blockGap=8
|
||||||
//% parts="ledmatrix"
|
//% parts="ledmatrix"
|
||||||
//% x.min=0 x.max=4 y.min=0 y.max=4 brightness.min=0 brightness.max=255
|
//% x.min=0 x.max=4 y.min=0 y.max=4 brightness.min=0 brightness.max=255
|
||||||
|
2
libs/core/shims.d.ts
vendored
2
libs/core/shims.d.ts
vendored
@ -456,7 +456,7 @@ declare namespace led {
|
|||||||
* @param y the vertical coordinate of the LED starting at 0
|
* @param y the vertical coordinate of the LED starting at 0
|
||||||
* @param brightness the brightness from 0 (off) to 255 (bright), eg:255
|
* @param brightness the brightness from 0 (off) to 255 (bright), eg:255
|
||||||
*/
|
*/
|
||||||
//% help=led/plot weight=78
|
//% help=led/plot-brightness weight=78
|
||||||
//% blockId=device_plot_brightness block="plot|x %x|y %y|brightness %brightness" blockGap=8
|
//% blockId=device_plot_brightness block="plot|x %x|y %y|brightness %brightness" blockGap=8
|
||||||
//% parts="ledmatrix"
|
//% parts="ledmatrix"
|
||||||
//% x.min=0 x.max=4 y.min=0 y.max=4 brightness.min=0 brightness.max=255
|
//% x.min=0 x.max=4 y.min=0 y.max=4 brightness.min=0 brightness.max=255
|
||||||
|
Loading…
Reference in New Issue
Block a user