Question: C++ programming; I have this program for a motion sensor how do i add a buzzer as an out put for when motion is detected

C++ programming;

I have this program for a motion sensor how do i add a buzzer as an out put for when motion is detected an set it so it has a overrule push button, so if the buzzer is going off and you push this button it stops and resets the system?

#include "mbed.h" #include "C12832.h" DigitalOut led1(LED1); DigitalOut led2(LED2); DigitalIn alarm(p29, PullUp); C12832 lcd(p5, p7, p6, p8, p11);

int main() { wait(1); lcd.cls(); //Clear screen while(1) { led1=1; led2=0; if (!alarm){ lcd.printf("THE MOTION HAS DETECTED"); wait(0.5); } else led1=0;

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!