Hi,
i am trying following code in my application
#include <msp430G2352.h>
void main(void)
{
WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer
P1DIR = BIT0;
P2SEL |= 0x00;
P2OUT |= BIT6;
P2REN |= BIT6;
while (1)
{
if(BIT6 & P2IN)
{
P1OUT |= BIT0;
}
else
{
P1OUT &= ~BIT0;
}
}
}
So essential i have P2.6 internally pulled up and set as input.
and if it is pulled high set P1.0 which is LED. and if P2.6 low turn off LED P1.0.
Now i am shorting P2.6 to GND purposly to see if LED turns off , but its not.
SO somehow P2.6 is not pulling low to turn off LED.
what is wrong in my code?
is P2.6 is not I/O pin?