Hi,
My first post here! Seems like a great forum; glad to be a member. I need to know when an input pin sees a 0-5V transition (must do with several pins; don't want to use interrupts).
In C I'd do it this way:
byte old, nowHigh;
old = pin_in; // set old as the old value of the pin
pause 10
nowHigh = pin_in & !old; // set nowHigh if it is now high but used to be low
My newbie questions:
1) In PBP is it smarter to use BIT variables to do this?
2) How do I get the NOT operator (! in C) in PBP? Or do I have to do something like
nowHigh = (pin_in==1) AND (old==0) ?
And what kind of variable is nowHigh = (pin_in==1) AND (old==0) anyway? Is it a BIT since pin_in is a bit, or if nowHigh is a BYTE is it automatically typecast to a BYTE?
Thanks for shedding any light on this!
- Jim
Bookmarks