That would be:
Code:
while( (pinout != 0x02) && (pinout !=0x04) && (pinout != 0x08 )
{
pinout = portD;
}
Or perhaps...
Code:
while( pinout > 0x01 )
{
pinout = portD;
}
On another note, the term global refers to the scope of the variable. A variable declared outside of all functions is a global variable. It can be modified by virutally everything. Consider:
Code:
#include <stdio.h>
int x; /* x is a global variable */
void foo( void )
{
x = 11; /* modifying it in foo */
}
int main( void )
{
foo( );
printf( "x is %d\n", x );
x = 5; /* modifying it in main */
printf("x is %d\n", x );
return 0;
}
Quzah.