Servo sample code

Anyone have source code to getting multiple (specifically I need six) servos working simultaneously with the organgutan? I want to do this with the PWM option. Each servo needs to be independent so I cant just pulse the C port high/low (which I can already do) . . . and I need my controller to do other stuff simultaneously as well. I used to do this with a PIC16F877 with 8 servos, I just cant figure out the syntax with the atmel . . .

Hello,

The hardware PWM on the AVR is connected to the motor driver and is therefore not particularly accessible on the Orangutan. There also aren’t that many PWM ports available, and as far as I know, there aren’t that many on the PIC16F877, either, so you must have been doing something more than just using the hardware PWM. Perhaps if you provide more details about your PIC solution, someone will be able to help you do the equivalent on the AVR.

By the way, just because you need the servos to be independent doesn’t mean you can’t generate the pulses by toggling the pins in software. Depending on the pulse width range you need, you could generate the 6 pulses, one after another, in 12 ms and then have another 8 ms for your other processing.

- Jan