Reply To: PIC16F877A with DC Gear Motor

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


What I meant was, I just want the whole program just to run once, what’s happening in the program now is that after the 5 seconds delay and RB1 becomes low, and then the program itself will go back to the initial part again, which is detect the push switch status (by this time it will turn on the RB1 because I haven’t turn off my switch), and turn on RB0 again. The program keeps repeating and repeating the whole sequence by itself.


Any way just to only let it run only once, without repeating itself? After each time it finishes running, everything will just switch off without running back to the first part of the program again. And when I press the push switch again, the program will run again just ONCE. I don’t want it to be keep running in an infinite loop.


I hope I explain myself well this time, thanks.