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