77ed2ccfb1
* 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
367 B
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);
}
})