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

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 Accounting Questions!