Turn off buzzer using ultrasonic sensor?

Hi. I'm working on a project in school and the idea i have is to create an alarm clock which you turn off using motion (walking past a sensor on your door frame). I have set up the code for the ultrasonic sensor to turn on an led when movement is detected (attached) but i would like it to turn off a buzzer when movement is detected instead. Any help on the code would be much appreciated.

sketch_UltasonicSensor.ino (601 Bytes)

1 Like