892a2d585f
* add threshold blocks * updated strings * added gap * reorg color/gyro blocks * fixing sound names * adding stop block * fixing exanmples
477 B
477 B
Reverse Beeper Activity 2
let beep = false
beep = true
control.runInBackground(function () {
motors.largeBC.setSpeed(-20)
sensors.ultrasonic4.pauseUntil(UltrasonicSensorEvent.ObjectNear)
motors.largeBC.stop()
beep = false
})
control.runInBackground(function () {
while (beep) {
if (sensors.ultrasonic4.distance() < 20) {
music.playTone(440, sensors.ultrasonic4.distance())
loops.pause(50)
}
}
})