|
Re: Vex Encoder Code
There's a typo in StartLeftEncoder.
state gets used in the if check instead of state1.
I'd consider standardizing your naming convention, e.g., ltick and lstate and loldstate or all the other way. The typos might make themselves more obvious that way.
Consider adding an else to your "<= 300" of pwm04=127;pwm03=127; so it's explicit that the motors are being turned off.
I'd try adding a printf to watch what ltick and rtick do when you turn the encoder by hand one revolution.
You're learning so much more writing this yourself!
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Last edited by Mark McLeod : 07-08-2006 at 19:36.
|