Question: MBED C++ programming Hi so I have this program for a motion but it doesn't work? what I want to happen is when motion is

MBED C++ programming

Hi so I have this program for a motion but it doesn't work? what I want to happen is when motion is detected, one LED will come on, and one will turn off then it will print a message on the LCD screen? the LCD is built in and its C128832.h the motion sensor is going into pin 29

#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!