pxt-ev3/docs/coding/light-the-way-3.md

13 lines
412 B
Markdown
Raw Normal View History

2018-01-06 04:14:55 +01:00
# Light the way Activity 3
```blocks
sensors.color3.onLightChanged(LightIntensityMode.Ambient, LightCondition.Bright, function () {
brick.clearScreen()
})
sensors.color3.onLightChanged(LightIntensityMode.Ambient, LightCondition.Dark, function () {
brick.showImage(images.objectsLightOn)
})
sensors.touch1.onEvent(TouchSensorEvent.Pressed, function () {
brick.showImage(images.objectsLightOn);
})
```