PICAXE 28X1, debug command and servo twitch
October 26, 2012
I came across something interesting, I thought I would mention. I had my robot plugged into my computer and was working on the IR range sensor. This meant I was reading the ADC pin and had a DEBUG command in the code to show me the values I was getting back.
While this was going on, one of the robots arm was ...twitching... a bit, like the robot had suddenly developed Parkinson's disease.
While trying to figure out why that was happening I removed the DEBUG command statement and the problem disappeared.
On reading the PICAXE manual today I found a section under the SERVO command that states that serial IO can cause the servo PWM to "pause". Since the DEBUG command uses serial IO to return the data to the compiler, this explains why using the DEBUG command causes my servo "twitch".
Just thought I would mention this in case someone else ran into a similar problem and was not lucky enough to guess that the DEBUG command could be a problem.