Schau mal nach dem INT0 bzw. INT1 Pin.
Hier ist ein kurzes Code-Schnipsel, wie man damit arbeiten kann:
Code:#include <avr/io.h> #include <avr/interrupt.h> #include <avr/signal.h> #include <inttypes.h> // key press down SIGNAL( SIG_INTERRUPT0 ) { // do stuff } // key pres up SIGNAL( SIG_INTERRUPT1 ) { // do other stuff } void interruptInit( void ) { // react on falling edges EICRA = (1<<ISC11)|(1<<ISC01); // enable INTO and INT1 EIMSK = (1<<INT1)|(1<<INT0); sei(); }
Lesezeichen