Hello everyone,
I'm in this weird situation and google won't give me the right answers. So... I made a robot that moves in a square area and it works perfectly except for one damn thing! The robot isn't suppose to move until I press the button.
It works perfectly fine when it's powered by the usb and the computer but when I plug in a 3V battery as its power source, the code for the "wait until the fricken button is pressed" is ignored. This is the line of code for wait until button is pushed:
while((P1IN & 0x08) == 0x08); //Wait until button is pushed
Another program that I use, which uses the exact line of code, does not show any problems when I run it using the 3V battery source. But, the hold button line works if it has some coding in front of it like flash some pretty LEDs, etc. My guess is the initial power up of the LaunchPad makes the line skip for some reason.
Helppppppppppppp pleaseeeeeeeee
Thank you.