Reply To: PIC16F877A with DC Gear Motor

Home Forums Microcontrollers PIC Microcontroller PIC16F877A with DC Gear Motor Reply To: PIC16F877A with DC Gear Motor

#11485
Shengo
Participant

No, sorry. Because I am just using wire connect directly to both RD0 and RD1 to test my circuit, when I connect RD0 to ground, LED1 lights up, when I connect RD1 to +5V, LED1 turns off then LED 2 lights up for 5 seconds then turn off.

 

The thing is the repeating part is not the “if” part at the push button, it is the second “if” part of the code, which is the 5 seconds turn on then off the LED2. Must I use a push button to test the circuit? Because I’m planning to use a sensor for RD1 though, only push button for RD0.

 

Or is there any problem with my code?

 

Thanks.

>