ruhulamineee
Newbie level 6
Hello Every One,
can i use atmega8 for pulse generator in c programing with different duty cycle like 10%, 30%, 50%.
my code was:
if(adc(0)==1){PROTB.0=1; delay_ms(15); PORTB.0=0;delay_ms(5)};
if(adc(1)==1){PROTB.1=1; delay_ms(14); PORTB.1=0;delay_ms(6)};
but its not working according to my duty cycle. how can i crate proper duty cycle.
Thank u
can i use atmega8 for pulse generator in c programing with different duty cycle like 10%, 30%, 50%.
my code was:
if(adc(0)==1){PROTB.0=1; delay_ms(15); PORTB.0=0;delay_ms(5)};
if(adc(1)==1){PROTB.1=1; delay_ms(14); PORTB.1=0;delay_ms(6)};
but its not working according to my duty cycle. how can i crate proper duty cycle.
Thank u