Advertisement
Guest User

Untitled

a guest
Sep 1st, 2015
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. /*
  2. * KEY_SNIFF.c
  3. *
  4. * Created: 2015-02-25 오후 2:48:34
  5. * Author: Jaeki
  6. */
  7.  
  8.  
  9. #include <avr/io.h>
  10. #include <avr/interrupt.h>
  11. ISR(INT0_vect)
  12. {
  13.  
  14. PORTA = 0xff;
  15. }
  16.  
  17.  
  18. int main(void)
  19. {
  20. DDRA = 0xff;
  21. //DDRC = 0xff;
  22. //PORTA = 0x00;
  23. //PORTC = 0xff;
  24.  
  25. cli(); //초반에 인터럽트를 초기화 해준다.
  26. EIMSK = 0b00000001;
  27. EICRA = 0b00000010;
  28. EIFR = 0b00000000;
  29. sei();
  30.  
  31. while(1){
  32. printf("Wait your SIGNAL\n")
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement