Andy2k7
Newbie level 3
This is my code so far and I'm not really sure what I should be putting in the switch statement so that when I push the button connected to P1.3 LED0 will be toggled and when I push the one connected to P1.7 LED1 will be toggled.
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 #include "io430.h" #define LED0 BIT0 #define LED1 BIT6 void main( void ) { // Stop watchdog timer to prevent time out reset WDTCTL = WDTPW + WDTHOLD; P1DIR |= (LED0 + LED1); P1OUT &= ~(LED0 + LED1); P1IE |= (BIT3 + BIT7); __enable_interrupt(); while(1) { } } #pragma vector=PORT1_VECTOR __interrupt void Port_1(void) { switch(P1IFG) { case ????: P1OUT ^= LED0; // P1.0 = toggle; case ????: P1OUT ^= LED1; // P1.6 = toggle } P1IFG &= ~(BIT3 + BIT7); // P1.3 IFG cleared }