We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I have been trying to use this command but only being a novice I am lost. I get error 67 - undefined error. can anyone tell me how to define input pin? thanks
Well, I'm not sure which pin you're after, but if you wanted to check the status of, say, pin 5 of port 3, the you'd write something like this:
if ( ( P3 & (1 << 5) ) == 1 ) /* do something here */;
/* declare special bit */ sbit my_pin = P3 ^ 5; ... if ( py_pin == 1 ) /* do something here */;
Thanks very much. Have a better idea of where i heading now. Much appreciated.
Sorry, I meant
if ( ( P3 & (1 << 5) ) != 0 )
if ( ( P3 & (1 << 5) ) == 1 )