
Originally Posted by
Joe S.
Hi Chris,
I have only a little experience with servos, and do not have my computer at hand, but the best I remember, if I sent a number to my servo it executed fully before accepting a new value, so I am thinking if you send a count to the servo something like 1500, 1510, 1520 . . . to cause movement you can snuggle an interrupt between the numbers.
EDIT: after reading your code, looks like pretty much what you are doing. I'm empty.
I see no interrupt in your code, Why would you be able to stop it? I never have been able to hijack the count variable in a for next loop, you might try using an interrupt routine and clearing the variable in there, I do not know if it will work though.
Could be latency, could be Breadboard issues where stray capacitance stops the oscillator, could be power supply causing PIC brownout reset, I see no config statement so I assume you are using default config, . . . could be GOTO MAIN at the end of servomove when you used gosub to get there, causing a stack overflow, and eventual reset. . . . On closer inspection looks like you have a return and goto main in there . . . I don't know how that would affect operation if at all since theoretically the code should never go past the return, but who knows? Computers (and PICs) are stupid, but not sloppy, they only do what you tell them to do, whether intentionally or not.
Keep us posted, I would like to see your Final Cut, looks like it would make a cool VR control for a camera in an RC heli.
Bookmarks