AHA Moment
Ok so I finally had an AHA moment about why my servos "weren't working". My servos would just jerk and not do much. I tried my perf board that I wired up for my manual transmission robot. I tried a 28x1 project board with the same result. Well tonight I finally figured it out.
It was code. (prepare to laugh) Between servo commands I was using sleep 100. I was assuming this was 100 milliseconds. It is actually something like 200 seconds. I changed them to wait 1 (which is wit one second) and they now work.
I wanted to admit my mistake so others learn that you shouldnt always assume your code isnt the problem. My code looks very simple, but since I didn't fully understand the sleep command and it wasted me hours of tinkering. Always double check your code (line by line and UNDERSTAND it) and check your wiring.



@ Thu, 2008-07-10 20:21
I had a million of these
I had a million of these moments!! :D
And yes, you are right, one learn to ask the right questions!
@ Fri, 2008-07-11 00:23
Me too
I just got a high-torque servo tonight. It may work to shift the battery about in my biped (which I may ressurect this w/e).
Could I get the servo to shift? Nah. Than after about an hour I remembered that the last thing I had coded was an "enable" bit for each servo output to save power...
D'oh. The outputs are disabled unless explicitly enabled.
@ Thu, 2008-07-10 09:28
You need a wait after the
@ Thu, 2008-07-10 11:24
yep...there's a missing wait
yep...there's a missing wait command before the 'goto'.
you can also use the PAUSE command to work in milliseconds...so PAUSE 1000 would be equivalent to WAIT 1
@ Thu, 2008-07-10 16:13
Thats what got me in trouble