Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<avr/io.h>
- #include<avr/interrupt.h>
- volatile int counter;
- ISR(TIMER0_OVF_vect){
- if(counter == 20){
- counter = 0;
- PORTA = !PORTA;
- }
- TCNT0 = 235;
- counter++;
- }
- int main(void){
- TCCR0 |= (1<<CS00) | (1<<CS02);
- TIMSK |= (1<<TOIE0);
- TCNT0 = 0;
- DDRA = 0xFF;
- sei();
- PORTA = 235;
- counter = 0;
- while(1){}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement