gold12star
Junior Member level 3
hello
I face problame in controlling servo motor
I use pic16f877a programming by mikroC
I need the motor to move (0 , 90, 180) degree is the following code correct or not??
if not please help me as soon as possible
thank you
I face problame in controlling servo motor
I use pic16f877a programming by mikroC
I need the motor to move (0 , 90, 180) degree is the following code correct or not??
if not please help me as soon as possible
Code:
void main() {
portc=0b00000100;
trisc=0b00000000;
PWM1_Init(5000);
PWM1_Start();
PWM1_Set_Duty(255);
delay_us(1500);
PWM1_Start();
PWM1_Set_Duty(255);
delay_ms(2);
PWM1_Start();
PWM1_Set_Duty(255);
delay_ms(1);
}
thank you