Advertisement
Guest User

Untitled

a guest
Feb 27th, 2015
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. ISR(USART_RX_vect)
  2. {
  3. cli();
  4. while(!(UCSR0A&(1<<RXC0))){};
  5. // clear the USART interrupt
  6. received = UDR0;
  7.  
  8. if(pinState == 0)
  9. {
  10. OCR2A = received;
  11. pinState = 1;
  12. }
  13. else if(pinState == 1)
  14. {
  15. OCR2B = received;
  16. pinState = 2;
  17. }
  18. else
  19. {
  20. OCR0A = received;
  21. pinState = 0;
  22. }
  23. sei();
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement