Advertisement
Guest User

Untitled

a guest
Dec 18th, 2014
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.27 KB | None | 0 0
  1. #include <avr/io.h>
  2. #include <avr/interrupt.h>
  3.  
  4. int main (void)
  5. {
  6. DDRB |= (1 << PB2);
  7. TCCR1B|=(1 << WGM12);
  8. OCR1A=27;
  9. TCCR1B|=(1 << CS10);
  10. TIMSK |= (1 << OCIE1A);
  11. TIMSK |= (1 << OCIE1B);
  12. sei();
  13. while(1)
  14. {
  15. }}
  16.  
  17. ISR(TIMER1_COMPA_vect)
  18. {
  19. PORTB ^= (1<<PB2);
  20.  
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement