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
16 lines
367 B
Markdown
16 lines
367 B
Markdown
# @extends
|
|
|
|
## #examples
|
|
|
|
## Example: adjusting screen brightness
|
|
|
|
If the [light level](/reference/input/light-level) is `< 100`, this code sets the brightness to `255` when the button A is pressed:
|
|
|
|
```blocks
|
|
input.onButtonEvent(Button.A, input.buttonEventValue(ButtonEvent.Down), () => {
|
|
if(input.lightLevel()<100){
|
|
led.setBrightness(255);
|
|
}
|
|
})
|
|
```
|