My chip seems to be acting very strange. It doesn't complete loops and slows down. I've attached the source code, th results and a pic of the breadboard. Any ideas?
I checked you code and used it on my ultrasonic servo motor and it works as programmed.
The problem is not really with the code, but maybe the servo is drawing too much current and browning out the chip causing it to reset to the beginning.
What voltage does the servo use?
Mine are connected to 6 volts not 5 volts, and the whole thing runs from a small sealed lead-acid battery (1.3 AH).
I'm using the 5 volts off the 5 volt regulator so I'll try to get higher voltage for the servo. Off hand is 7.2 too much? That's my input before the regulator.
Hey Clive, many thanks, I upped the voltage to 7.2 (6 NIMH's @ 1.2 volts) on the servo and it works as it should. Again from your experience would 7.2 be too much? I'm just being lazy and trying to avoid going out to buy a six volt regulator [noparse]:)[/noparse]
Thanks again Clive. Duh, 6 volts from 7.2 would be quite a reach, maybe a zener, or a couple of regular diodes to drop the voltage, I'm not an expert so this might not work, just a thought. I tried the 7.2 v though and it works quite well. Unfortunately I left the Pings attached to the BOE (I use this as a test environment) and while the servos worked really nicely I fried two Pings - bah. I getting to be a mini Thomas Edison as I have learned dozens of things that don't work. Good luck with your servos!
Comments
The problem is not really with the code, but maybe the servo is drawing too much current and browning out the chip causing it to reset to the beginning.
What voltage does the servo use?
Mine are connected to 6 volts not 5 volts, and the whole thing runs from a small sealed lead-acid battery (1.3 AH).
I looked at the tech docs for the ones sold by Parallax and one doesn't provide any torque at 5volts, so needs a bit more voltage.
Also I don't think there is a six volt regulator that would work with a 7.2 volt input (possiblility not enough input voltage).
(I was up to 1am (Australian time) re-programming my robot so the sweep ultrasonic servo runs smooth.)