w.r.t ez430-rf2500
I am trying to do something very simple here. i want to push the button, and see the LEDs light up. it is part of a complex code, but this push button is giving me some problems, someone please tell me what is my mistake. I am pasting the snippet.
P1OUT = 0x00; //preloading LEDs to be off
P1DIR = 0x03; //setting LED pins to be outputs
while(1)
{
if ((P1IN&0X04) == 0x00) //p1.2 is for the button. I tried the logic operation result with 0 and 1.Neither worked
{
P1OUT = 0X03; //if button pressed, LED on,
}
else
P1OUT = 0X00; //else, LED off