Re: Use a switch by change not on/off status.
I have used the following on a few occasions quite successfully:
Lets say the switch is on portc.3
SW VAR PORTC.3
WHILE SW = 0 : WEND 'THIS WILL CONTINUALLY LOOP AS LONG AS THE INPUT IS LOW, MAKE IT SW = 1 TO DETECT
'GOING LOW.
' ASSUMES THAT ALL YOU ARE DOING IS WAITING FOR A SWITCH CHANGE
'ACCORDING TO THE MANUAL THIS LOOP CHECKS ABOUT 50 TIMES A SECOND
'SO IT SHOULD SEE THE CHANGE WITHIN 1/50 OF A SECOND.
DO SOMETHING HERE 'THIS IS WHAT YOU WANT TO DO AT THE SWITCH CHANGE
Last edited by muddy0409; - 22nd November 2014 at 12:16.
Peter Moritz.
Up the bush, Western Plains,
New South Wales,
Australia.
Bookmarks