Newb needs help with loop issues
I am sure that this will be completely easy for most of you but I haven't got a clue. I am writing code for use with a pic microcontroller and I am having problems with my while statements. My program uses hex values but it shouldn't be any different. I am assigning a char (pinout) to the port that I am recieving inputs from.
Here is my problem:
I need to read the port and hold the value to keep the while loop repeating until a different certain input is given through the port.
Here is some code, maybe seeing it will help more.
This switch statement works and will run the correct void.
My problem is with the loop statement for the void.
My problem is that "pinout' has to return to 0x00. "Pinout" is 0x01 for a milisecond. Just enough time to enter the void. After that it goes to 0x00 and remains there.
while((pinout == 0x00) || (pinout == 0x01))
pinout = portD;
I need the loop to continue until "pinout" is 0x02, 0x04, or 0x08. Any suggestions would help alot. Also, this is my first post so no flaming, pls. :D