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