pxt-ev3/docs/coding/ignition-3.md
2018-01-05 21:40:11 -08:00

14 lines
344 B
Markdown

# 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);
}
loops.pause(1);
}
```