#include int main(void) { WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer P1DIR |= 0x01; // P1.0 (LED) als output alle anderen Ports als Eingang P1IE |= 0x02; // P1.1 interrupt enabled P1IES |= 0x02; // P1.1 Hi/lo edge Interrupt bei fallender Flanke P1IFG &= ~0x02; // P1.1 IFG cleared, Hier steht im Buch etwas anderes prüfen warum nicht 0x00 __bis_SR_register(LPM3_bits + GIE); // Enter LPM3 w/ Globale interrupt enabled, LPM3 = alles aus, ausser ALCK } #pragma vector=PORT1_VECTOR __interrupt void Port_1(void) { if (P1IN & 0x02) // gesamten Port 1 einlesen und mit 00000010 vergleichen { } else { } P1OUT ^= 0x01; // P1.0 = toggle der LED P1IFG &= ~0x02; // P1.1 IFG cleared, lässt man dies weg, wird nur eine ISR ausgeführt. }