pxt-ev3/docs/examples/happy-unhappy.md

12 lines
290 B
Markdown
Raw Normal View History

2017-11-29 00:23:54 +01:00
# Happy unhappy
Use a touch sensor to make the brick happy.
```blocks
sensors.touch1.onEvent(ButtonEvent.Pressed, function () {
2017-11-29 00:23:54 +01:00
brick.showImage(images.expressionsBigSmile)
})
sensors.touch1.onEvent(ButtonEvent.Released, function () {
2017-11-29 00:23:54 +01:00
brick.showImage(images.expressionsSick)
})
```