pxt-calliope/docs/blocks/logic/if.md
Sam El-Husseini e3975e65e5 pxt-microbit Accessibility PR (#529)
* Accessibility changes
2017-09-07 13:42:08 -07:00

327 B

@extends

#examples

Example: adjusting screen brightness

If the light level is < 100, this code sets the brightness to 255 when the button A is pressed:

input.onButtonPressed(Button.A, () => {
    if(input.lightLevel()<100){
        led.setBrightness(255);
    }
})