Just a simple question,
(i realise the answer is probably in a manual but I'm running a bit short of time)
I have a 7seg display and a picaxe-18 chip, the code below shows a section of what I have at the moment, label_3 displays number 3. Then if one switch is closed the number increases, the other switch decreases the number and the third switch resets to number 5.
The inc/dec switches are controlled by tilt switches but to stop an accidental knock causing the number to change how can i programme it so that the switch needs to be closed for, say, 0.5sec before the jumps to the next number?
Many thanks
(i realise the answer is probably in a manual but I'm running a bit short of time)
I have a 7seg display and a picaxe-18 chip, the code below shows a section of what I have at the moment, label_3 displays number 3. Then if one switch is closed the number increases, the other switch decreases the number and the third switch resets to number 5.
The inc/dec switches are controlled by tilt switches but to stop an accidental knock causing the number to change how can i programme it so that the switch needs to be closed for, say, 0.5sec before the jumps to the next number?
Code:
label_3: let pins=%01001111
pause 500
label_3a: if pin6=1 then label_2
label_3b: if pin7=1 then label_4
label_3r: if pin1=1 then label_5
goto label_3a
label_4: let pins=%01100110
pause 500
label_4a: if pin6=1 then label_3
label_4b: if pin7=1 then label_5
label_4r: if pin1=1 then label_5
goto label_4a