Look in the book that came with your Picbasic pro at while......wend
Look in the book that came with your Picbasic pro at while......wend
Hi Mat
Thank you for replying. I'm still unable to fathom out how this helps. Please put me right. While...Wend allows me to check the pin status while, for example, the pin is high but if the timekeeper holds down the microswitch then the pin will be held continually high and my 'checking' will continue and therefore continue to decrement the following counter etc. What I want is the pin to go high from the timekeeper, check the circuit (decrement the counter) and be unable to check again until the pin has gone low (timekeeper releases the microswitch) and then goes high again (he presses it again). Every time he presses his switch the value in the EEPROM is decremented towards zero. If the pin is held high continually, how do I stop the loop rolling round and repeadedly decrementing the counter?
Adrian
With the folowing lines an input pin gives a pulse during 1 complete program cycle and a new pulse wil be generated after changing the input state back to 0 and brought back to 1 again yust what you want.
HULP0 VAR BIT
PULSE VAR BIT
INPUTPIN VAR PORTX.Y
PULSE = INPUTPIN & ~ HULP0
HULP0 = INPUTPIN
succes with it.
Thank you Mat - that looks really interestiung. I'll try it.
Kind regards
Adrian
Mat - the code worked great - also, as a newcomer to these techiques my understanding and use of bitwise operators has taken a leap forward. Thank you once again
Adrian
Bookmarks