school project, help needed
confused2
Posts: 1
we are doing a mini project in class where we have to pushh a button three times to make a light turn on for 15 second. i have the code setup to where i push the button once to have the led come on for 15 seconds. my question is what code do i have to put in so that the led wont come on until i push the button three times? this is what i have so far:
' {$STAMP BS2}
' {$PBASIC 2.5}
DO
counter VAR Word
IF IN3 = 1· THEN
HIGH 14
PAUSE 15000
LOW 14
ELSE
· PAUSE 10
ENDIF
LOOP
thanks
' {$STAMP BS2}
' {$PBASIC 2.5}
DO
counter VAR Word
IF IN3 = 1· THEN
HIGH 14
PAUSE 15000
LOW 14
ELSE
· PAUSE 10
ENDIF
LOOP
thanks
Comments
You have a good start, but want you want to do is in your "IF IN3 = 1 THEN" section, make the code add 1 to the counter (instead of turning on the light).
Then make another section that says "IF counter = 3 THEN" and put your code in there that turns on the light.
I hope this is helpful, I don't want to give to much away.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Did you know that 111,111,111 multiplied by 111,111,111 equals 12345678987654321 ?
www.iElectronicDesigns.com
·