pxt-ev3/docs/coding/ignition-3.md

14 lines
338 B
Markdown
Raw Normal View History

2018-01-06 06:40:11 +01:00
# Ignition Activity 3
```blocks
while (true) {
if (sensors.ultrasonic4.distance() < 10 &&
sensors.touch1.wasPressed() &&
brick.buttonEnter.wasPressed()) {
music.playSoundEffectUntilDone(sounds.mechanicalMotorStart)
music.playSoundEffectUntilDone(sounds.mechanicalMotorIdle);
}
pause(1);
2018-01-06 06:40:11 +01:00
}
```