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

302 B

Ignition Activity 2

while (true) {
    if (sensors.touch1.wasPressed() &&
        sensors.ultrasonic4.distance() < 10) {
        music.playSoundEffectUntilDone(sounds.mechanicalMotorStart)
        music.playSoundEffectUntilDone(sounds.mechanicalMotorIdle);
    }
    loops.pause(1);
}