support for led.plotBrightness (#494)
* support for led.plotBrightness * fixing c++ build * fixed blockid
This commit is contained in:
		
				
					committed by
					
						
						Sam El-Husseini
					
				
			
			
				
	
			
			
			
						parent
						
							e1764567c5
						
					
				
				
					commit
					e7c1915076
				
			@@ -22,4 +22,5 @@ led.enable(false)
 | 
			
		||||
 | 
			
		||||
### 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),
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										69
									
								
								docs/reference/led/plotBrightness.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										69
									
								
								docs/reference/led/plotBrightness.md
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,69 @@
 | 
			
		||||
# Plot Brightness
 | 
			
		||||
 | 
			
		||||
Turn on a LED light with a specific brightness on the [LED screen](/device/screen).
 | 
			
		||||
 | 
			
		||||
```sig
 | 
			
		||||
led.plotBrightness(0,0, 128);
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
## ~hint
 | 
			
		||||
 | 
			
		||||
Use [unplot](/reference/led/unplot) to turn **off** an LED.
 | 
			
		||||
 | 
			
		||||
## ~
 | 
			
		||||
 | 
			
		||||
### Parameters
 | 
			
		||||
 | 
			
		||||
* ``x`` is a [number](/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](/types/number) that means the vertical
 | 
			
		||||
  spot on the LED screen (from top to bottom: 0, 1, 2, 3, or 4)
 | 
			
		||||
* ``brightness` is a [number](/types/number) that represents the brightness of the LED, from 0 (off) to 255 (full brightness)
 | 
			
		||||
 | 
			
		||||
If a parameter is [out of bounds](/reference/out-of-bounds) (a value
 | 
			
		||||
other than 0 to 4), then this function will do nothing.
 | 
			
		||||
 | 
			
		||||
### ~hint
 | 
			
		||||
 | 
			
		||||
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).
 | 
			
		||||
 | 
			
		||||
### ~
 | 
			
		||||
 | 
			
		||||
### Example: One LED
 | 
			
		||||
 | 
			
		||||
This program turns on the bottom right LED at 50% brightness
 | 
			
		||||
 | 
			
		||||
```blocks
 | 
			
		||||
led.plot(4, 4, 128)
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
### Example: Square
 | 
			
		||||
 | 
			
		||||
This program uses a [for loop](/blocks/loops/for)
 | 
			
		||||
and the `plotBrightness` function
 | 
			
		||||
to make a square around the edges of the LED screen.
 | 
			
		||||
 | 
			
		||||
```blocks
 | 
			
		||||
for (let i = 0; i < 5; i++) {
 | 
			
		||||
    led.plot(0, i, 64)
 | 
			
		||||
    led.plot(4, i, 128)
 | 
			
		||||
    led.plot(i, 0, 172)
 | 
			
		||||
    led.plot(i, 4, 255)
 | 
			
		||||
    basic.pause(500)
 | 
			
		||||
}
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
### ~hint
 | 
			
		||||
 | 
			
		||||
Use the [point](/reference/led/point) function to find out if an LED is
 | 
			
		||||
on or off.
 | 
			
		||||
 | 
			
		||||
### ~
 | 
			
		||||
 | 
			
		||||
### See also
 | 
			
		||||
 | 
			
		||||
[plot](/reference/led/plot), [unplot](/reference/led/unplot), [point](/reference/led/point), [LED screen](/device/screen)
 | 
			
		||||
		Reference in New Issue
	
	Block a user