pxt-calliope/docs/projects/light-level-calibrator.md

19 lines
345 B
Markdown
Raw Normal View History

# Light level Calibrator
2017-02-10 02:40:21 +01:00
Use this program to graph the light level.
Press ``A`` to scroll the value on the screen.
2017-02-10 02:40:21 +01:00
```blocks
let reading = 0
2017-02-10 02:40:21 +01:00
basic.forever(() => {
reading = input.lightLevel()
2017-02-10 02:40:21 +01:00
led.plotBarGraph(
reading,
255
2017-02-10 02:40:21 +01:00
)
if (input.buttonIsPressed(Button.A)) {
basic.showNumber(reading)
}
2017-02-10 02:40:21 +01:00
})
```