View Full Version : How to program servos
That line was it......please help.
~Bstemp
Treat them just like you would a motor, except that instead of outputting a speed from -127 to +127, you are outputting a position from -127 to +127. For fun, you can hook the servo to the PWM outputs for one of your motors, and play with the joystick to get a feel for how they work.
didn't work....any possible problems/solutions?
Alan Anderson
23-02-2004, 22:31
didn't work....any possible problems/solutions?
Have you connected a good 7.2v backup battery? That's where the servos get their power.
Treat them just like you would a motor, except that instead of outputting a speed from -127 to +127
-127 to +127?
I thought the readings had to be from 0 to 255...
Are you just adding 127 to the outputs at the end of your main loop?
Can you actually use +127 .. -127 and I just havent heard about it?
didn't work....any possible problems/solutions?
What didnt work? Did the motors just not move?
If you hook a victor up to the outputs, does the little orange light go solid?
If it dosent, it means that theres a problem with the code (probibly), and if it IS solid orange, and changes from green to red when you change the signal being sent to it (moving the joystick), then your servo is probibly broken.
Also, I read somewhere that last years servos dont work. That might be it.
-127 to +127?
I thought the readings had to be from 0 to 255...
Are you just adding 127 to the outputs at the end of your main loop?
Can you actually use +127 .. -127 and I just havent heard about it?
You do need to send 0 to 254! You get about 120 degrees of motion from the servo with that range and yes the 7.2 battery is required.
Kevin Karan
24-02-2004, 11:48
it realy doesnt matter, as long as its a char variable, it doent matter weather is singed or unsigned. And make sure whatever pwms your using are enabled, not used anywhere else and arnt set as digital i/os
You do need to send 0 to 254! You get about 120 degrees of motion from the servo with that range and yes the 7.2 battery is required.
Gene F is the man and God of all hardware. I thought that battery was for back up purposes only. I haven't tried it yet, but I'll plug in that battery. I know my code is correct, so it should work. Thank you guys for your help.
~zBStem
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.