2018-01-06 06:20:00 +01:00
|
|
|
# Reverse Beeper Activity 2
|
|
|
|
|
|
|
|
```blocks
|
2018-02-15 01:05:31 +01:00
|
|
|
forever(function () {
|
2018-01-06 06:20:00 +01:00
|
|
|
if (motors.largeB.speed() != 0 && sensors.ultrasonic4.distance() < 20) {
|
|
|
|
music.playTone(440, sensors.ultrasonic4.distance());
|
2018-02-15 01:05:31 +01:00
|
|
|
pause(50)
|
2018-01-06 06:20:00 +01:00
|
|
|
}
|
|
|
|
})
|
2018-02-19 16:35:08 +01:00
|
|
|
motors.largeBC.run(-20);
|
2018-01-06 06:20:00 +01:00
|
|
|
sensors.ultrasonic4.pauseUntil(UltrasonicSensorEvent.ObjectNear);
|
2018-01-09 21:46:48 +01:00
|
|
|
motors.largeBC.stop();
|
2018-01-06 06:20:00 +01:00
|
|
|
```
|