Tool/software: Code Composer Studio
I have a project , where assign one internal button to turn on both leds , other two external buttons to trun on red led and the other one tho trun on green led I make a code in C , but I dosent work I dont know what I miss to make my code funtional can this community help me ??
WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer P1DIR |= 0x41; P1OUT |= BIT3; P1OUT |= BIT4; P1OUT |= BIT5; P1REN |= BIT3; P1REN |= BIT4; P1REN |= BIT5; P1OUT &= ~BIT6; P1OUT &= ~BIT0; while (1) // Infinite Loop { while (P1IN & BIT3){ __delay_cycles(50000); } if ((BIT3 & P1IN)){ P1OUT &= ~BIT6; P1OUT &= ~BIT0; } if ((BIT4 & P1IN)) { P1OUT&= ~BIT0; } if ((BIT5 & P1IN)) { P1OUT &= ~BIT6; } else { P1OUT &= ~BIT6; P1OUT &= ~BIT0;} }}