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.

Originally Posted by
chrisshortys
Now the problem I am having is the FOR loop doesnt seem to be interuptable. So the servo will only respond to a new input once it has reached its current destination. I want to find a way to have the servo change direction before it reaches its end destination.
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.
The second issue i have is the programe seems to freeze at times. The LCD does not update and the programe does not recognise any change in input for a while before suddenly snapping back into life.
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.
Last edited by Archangel; - 27th February 2009 at 19:36.
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
Bookmarks