Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <avr/io.h>
- #include <avr/interrupt.h>
- ISR (TIMER0_COMPA_vect)
- {
- static uint8_t licznik = 0;
- if (!licznik) { PORTB ^= _BV(5); }
- if (++licznik > 8) { licznik = 0; }
- }
- int main (void)
- {
- DDRB |= _BV(5);
- TCCR0B |= _BV(CS02) | _BV(CS00); // ustawiamy prescaler
- TIMSK0 |= _BV(OCIE0A);
- sei();
- for (;;);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement