Alo. I wish to have a servo move from 0 to 255 during autonomous mode, but I can’t seem to get it to work at all. I’ve tried just hard-setting it to 255 and also moving it in increments (25 every loop), but neither method seems to work. Anyone have a solution?
Servo power is supplied by the 7.2v backup battery. Do you have one installed?
Yes, we do. I’m just not sure how to run it software-wise.
Also, I tested the autonomous with the dashboard hooked up, and the PWM that I have the servo hooked up to actually DID move to 254, but the servo itself didn’t budge at all, yet the servo works with the controls on the OI… I know that the autonomous works with motors…but not with servos… >_<
If it’s working in teleop mode but not in autonomous, I’m going to guess that you’re using the camera code from Kevin Watson, and your servo is on pwm13, pwm14, pwm15, or pwm16. If I’ve guessed correctly, read on. If not, I don’t know what to tell you.
Kevin included a very nice PWM driver with the camera code. However, he didn’t replace all of the original calls to Generate_Pwms() with calls to the new PWM(). Make the change yourself near the end of the autonomous loop.
Actually, I already did make the change. However, it still didn’t work (servo is on PWM 15).
Is moving a servo in autonomous even possible?
Yes, it is definitely possible, with no fancy tricks required. It sounds like you’ve got some issues with using PWM 13-16.
our camera is mounted on 11 and 12. We have absolutly no problems. Try using a different pwm port.
Alright, I’ll give that a shot, and I’ll post the results. Thanks
Thank you very much. I was using PWM 15, and as soon as I changed it to PWM 11 it worked just how it was supposed to.
Best of luck in the competition.