Question
Mr. Ndugu is using a HC-SR505 PIR motion sensor module in a lab project. ) Please suggest Mr. Ndugu a proper way to connect this
Mr. Ndugu is using a HC-SR505 PIR motion sensor module in a lab project. ) Please suggest Mr. Ndugu a proper way to connect this sensor to the Open1768 development board (i.e. to which pins, etc) and to configure the selected pins! (4 points). Let us assume that Mr. Ndugu wants to detect a rising edge of a signal generated by the sensor over the pin P2.7 (Pin 7 of Port2). For this purpose, he has written the following C code lines: //waiting for the falling edge
while (((LPC_GPIO2->FIOPIN) & 0*0080) ==1);
//all 4 LED ON if falling edge detected
LPC_GPIO2->FIOCLR=0*0F; //LED ON
Unfortunately, these code lines do not deliver the expected behavior. Please help Mr Ndugu to find and correct the error(s)! (6 points)Please change the C Code lines given above in such a way that LED0 and LED3 on the Open1768 development board are switched ON while LED1 and LED2 are switched OFF if a rising edge has been detected on pin P2.7. (5 points)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started