Go Down

Topic: Help with 19 servos and Mega (Read 1 time) previous topic - next topic

zoomkat

#5
Aug 03, 2011, 02:26 am Last Edit: Aug 03, 2011, 02:30 am by zoomkat Reason: 1
Usually a servo library is used that provides for the PPM control signals that standard hobby servos use.

edit: a simple write up on hobby servos.

http://www.lynxmotion.com/images/html/servo01.htm
Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   8)

ElectricalStorm

Quote
Usually a servo library is used that provides for the PPM control signals that standard hobby servos use.


I agree, i understand PWM and servo's. But I was wondering why vinceherman doesn't use the PWM but the digital out for driving his servos.

Quote
You don't use PWM output.  That is for driving DC motors and LEDs.
Just grab the digital pins and attach the servos.


It would be nice to see some more code to achieve that.

Chris

mem


Quote
Usually a servo library is used that provides for the PPM control signals that standard hobby servos use.


I agree, i understand PWM and servo's. But I was wondering why vinceherman doesn't use the PWM but the digital out for driving his servos.

Quote
You don't use PWM output.  That is for driving DC motors and LEDs.
Just grab the digital pins and attach the servos.


It would be nice to see some more code to achieve that.

Chris


The Arduino servo library uses hardware timers to control servo pulses to enable many more servos to be controlled than if the hardware PWM capability was used. The source code for the Servo library is in the Libraries > Servo directory of the arduino distribution.

ElectricalStorm

Thanks mem,

I completely misinterpreted the PWM/Servo part in Arduino.

I thought the servo commands (Servo myservo, myservo.attach(2), myservo.write (170)) could only be used on the PWM outputs (2 to 13 on the Mega). Now I see they can be used on any digial output (22 to 53).

My mistake,
Chris

mem

Chris,

You can use any of the outputs, including any of the unused PWM or analog input pins.

Go Up