pxt-calliope/docs/blocks/logic/if.md
Juri Wolf 77ed2ccfb1
V4 updates (#210)
* update pxt.json files

* Fix button event enums

fixes https://github.com/microsoft/pxt-calliope/issues/206

* Fix Safari CSS Rule for iOS app

fixes https://github.com/microsoft/pxt-calliope/issues/205

* aprove preffered repos

should fix https://github.com/microsoft/pxt-calliope/issues/167
2023-01-11 09:51:27 -08:00

367 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.onButtonEvent(Button.A, input.buttonEventValue(ButtonEvent.Down), () => {
    if(input.lightLevel()<100){
        led.setBrightness(255);
    }
})