hi every one
i need to control servo motor by pwm in pic 16f877a
i control it by normal loop
i try this code but run motor in one direction
help please
thanks
i need to control servo motor by pwm in pic 16f877a
i control it by normal loop
for(b=0;b<100;b++) // graper close
{
portb=0b00000001;
delay_us(3000);
portb=0;
delay_ms(20);
}
i need to control it by pwmvoid main() {
trisc=0b00000010;
trisb=0;
trisb=0;
pwm2_init(1000);
pwm2_start();
pwm2_set_duty(1);
portb=0;
}
i try this code but run motor in one direction
help please
thanks