pxt-calliope/docs/reference/led/set-brightness.md
2016-04-13 08:27:45 -07:00

735 B

Set Brightness

Sets the brightness of the LED screen.

led.setBrightness(121)

Parameters

  • value : Number - the brightness of the LED screen expressed as a number between 0 and 255

Example: change brightness

The following example sets the screen brightness to 100% (255), turns on LED 2, 2, waits for a second and then sets the screen brightness to 50% (127):

led.setBrightness(255)
led.plot(2, 2)
basic.pause(1000)
led.setBrightness(127)

Lessons

night light

See also

brightness, fade in, fade out, LED screen