Help with Push Button Game Please!
Eschatt
Posts: 16
Hi,
I have hit a wall recently. I am trying to count how many times a push button is pushed in 8 seconds, at the end of the 8 seconds, ideally the basic stamp would be able to turn on an LED. Signaling that the push button was hit the correct number of times in the 8 seconds (for my example I used 4 times). I have tested the push button with a simple debug code and it is working properly. I have attached the code that I have been working with to this post. Is what I described possible? and if so am I on the right track? Any help would be much appreciated! Thanks!
-Eschatt
I have hit a wall recently. I am trying to count how many times a push button is pushed in 8 seconds, at the end of the 8 seconds, ideally the basic stamp would be able to turn on an LED. Signaling that the push button was hit the correct number of times in the 8 seconds (for my example I used 4 times). I have tested the push button with a simple debug code and it is working properly. I have attached the code that I have been working with to this post. Is what I described possible? and if so am I on the right track? Any help would be much appreciated! Thanks!
-Eschatt
bs2
380B
Comments
For example:
COUNT 10, 8000, variable······· ' Count how many times IN10 equels 1 in 8 seconds and store it in variable
IF (variable = 4) THEN··········· ' If clicked 4 times
· High LED··························· ' Insert whatever you want it to do here.
ELSEIF (variable <> 4) THEN··· ' If is not clicked 4 times
· GOTO Beginning·················· ' Goto the beginning
END
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Dan Taylor
Sounds great, but, when the push button is pressed it is 0 for a second or so (several lines on the debugger). Do I need to change anything so that each push is counted as only one zero (do I need to/can I change the frequency of how often the BS2 checks IN10 while using the COUNT command)? Thanks.
-Eschatt
Post Edited (Eschatt) : 2/27/2009 1:06:31 AM GMT
Do you even need the debugger?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Dan Taylor