If your MCU supports interrupts; I would place the call to the function in the interrupt service routine.
Tim S.
If your MCU supports interrupts; I would place the call to the function in the interrupt service routine.
Tim S.
It only enters the loop while the condition is true. If it's not true when it reaches the loop the first time, it's going to skip it completely. If you need it to execute at least once, use a do-while. Or, put what always has to happen first outside the loop, and then if it needs to be inside too, put it there too.
Quzah.
Hope is the first step on the road to disappointment.
Well I actually don't necessarily want it to execute all the way through any of the sub loops (and their are lots of them within the main while loop which is triggered by the HIGH pin) in my program even once. I just want it to operate like a switch... as soon as I tell it to stop, I want it to stop and exit the loop in the program.
So far GOTO, Break, and everything else suggested works but it doesn't immediately get out. It finishes the sub loop it's currently in and THEN exits. That's not quite what I'm looking for.
I want the program to drop what it's doing and exit the main while loop that houses the other loops within the program.
Any pointers on that?
Last edited by 777funk; 11-24-2010 at 08:00 PM.