Control Servo Position using ATxmega128A1

General discussion on mikroPascal PRO for AVR.
Post Reply
Author
Message
PersianPatient
Posts: 15
Joined: 06 Jul 2012 06:50

Control Servo Position using ATxmega128A1

#1 Post by PersianPatient » 14 Jul 2012 10:42

Hello ,

I plan to control servo position using an atxmega128a1 . I have a RC servo ( Hitec HS-325HB ) connected to PWM1 on port C . I wrote my program like this :

Code: Select all

PWM_C0_Init(50,_PWM_SINGLE_SLOPE);
PWM_C0_Start(_CCA_CHANNEL);
PWM_C0_Set_Duty(I,_PWM_NON_INVERTED,_CCA_CHANNEL);
delay_ms(20);
where I is a number between 0 and 255

but my servo did not moved . I have no idea how to use pwm library to control a rc servo , I will be glad if somebody can help me .

Best Regards,
Amir .

Post Reply

Return to “mikroPascal PRO for AVR General”