Skip to content

Instantly share code, notes, and snippets.

@Jack2
Created September 2, 2015 02:20
Show Gist options
  • Save Jack2/89e9c10e415f6feb196f to your computer and use it in GitHub Desktop.
Save Jack2/89e9c10e415f6feb196f to your computer and use it in GitHub Desktop.
/*
* KEY_SNIFF.c
*
* Created: 2015-02-25 오후 2:48:34
* Author: Jaeki
*/
#include <avr/io.h>
#include <avr/interrupt.h>
ISR(INT0_vect)
{
PORTA = 0xff;
}
int main(void)
{
DDRA = 0xff;
//DDRC = 0xff;
//PORTA = 0x00;
//PORTC = 0xff;
cli(); //초반에 인터럽트를 초기화 해준다.
EIMSK = 0b00000001;
EICRA = 0b00000010;
EIFR = 0b00000000;
sei();
while(1){
printf("Wait your SIGNAL\n")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment