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

616 B

Brightness

Find how bright the LED screen is.

led.brightness();

Returns

  • a Number that means how bright the screen is, from 0 (darkest) to 255 (brightest). For example, the number 127 means the screen is halfway bright.

Example: highest brightness

This program makes the screen completely bright if it is not that way already:

if (led.brightness() < 255) {
    led.setBrightness(255)
}

See also

set brightness, fade in, fade out