pxt-calliope/docs/blocks/logic/if.md
Peli de Halleux fb5bb396e1 more migration to common docs (#370)
* more migration to common docs

* refactoring js

* removed duplicate docs

* migrating more docs

* more refactoring

* migrated browsers page

* updated summary
2017-03-14 12:07:17 -07:00

16 lines
328 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.onButtonPressed(Button.A, () => {
if(input.lightLevel()<100){
led.setBrightness(255);
}
})
```