Don't ad-block us - support your favorite websites. We have safe, unobstrusive, robotics related ads that you actually want to see - see here for more.
0 Members and 1 Guest are viewing this topic.
# include<avr/io.h>int main(void) // for 8 mhz internal oscillator 1 sec gap//{ DDRC|=_BV(0);//set port c pin 0 as output TCCR1B|=(1<<CS12);//start 16 bit timer at prescaler of 256 where 1 sec=31250 clock ticks while(1) { if(TCNT1>=31250) { PORTC^=(1<<0);//toggle the pin on and off TCNT1=0;//make tcnt1 as 0 for restarting the counter } } return(1);}