basic stamp
marcuz
Posts: 5
·need help trying to use basic stamp for a game show buzzer circuit. i'm having trouble
getting only one led to light. if any of you programming genuis can help greatly appreciated.
' {$STAMP BS2}
' {$PORT COM4}
' {$PBASIC 2.5}
INPUT 1·········· 'switch to emcee box
INPUT 11········· 'contestant #1 switch
INPUT 13········· 'contestant #2 switch
INPUT 15········· 'contestant #3 switch
OUTPUT 0········· 'emcee buzzer
OUTPUT 3········· 'contestant buzzer
OUTPUT 5········· 'contestant #1 lamp
OUTPUT 7········· 'contestant #2 lamp
OUTPUT 9········· 'contestant #3 lamp
main:
OUT0 = IN1······· 'set buzzer to switch emcee switch
OUT5 = IN11······ 'set lamp 1 to switch 1
OUT7 = IN13······ 'set lamp 2 to switch 2
OUT9 = IN15······ 'set lamp 3 to switch 3
'DEBUG ? IN1
DEBUG ? IN13
DEBUG ? IN15
DEBUG ? IN11
DEBUG ? OUT3
IF IN1 = 1 THEN·· 'ring buzzer to alert emcee
OUT0 =1
PAUSE 2000
OUT0 = 0
PAUSE 2000
ENDIF
IF IN11 = 1 THEN·· 'ring buzzer to alert emcee
OUT3 =1
OUT5 =1
PAUSE 2000
OUT3 = 0
OUT5 = 0
PAUSE 2000
ENDIF
IF IN13 = 1 THEN·· 'ring buzzer to alert emcee
OUT3 = 1
OUT7 = 1
PAUSE 2000
OUT3 = 0
OUT7 = 0
PAUSE 2000
ENDIF
IF IN15 = 1 THEN·· 'ring buzzer to alert emcee
OUT3 = 1
OUT9 = 1
PAUSE 2000
OUT3 = 0
OUT9 = 0
PAUSE 2000
ENDIF
'PAUSE 500········ 'short pause
GOTO main········ 'start over
getting only one led to light. if any of you programming genuis can help greatly appreciated.
' {$STAMP BS2}
' {$PORT COM4}
' {$PBASIC 2.5}
INPUT 1·········· 'switch to emcee box
INPUT 11········· 'contestant #1 switch
INPUT 13········· 'contestant #2 switch
INPUT 15········· 'contestant #3 switch
OUTPUT 0········· 'emcee buzzer
OUTPUT 3········· 'contestant buzzer
OUTPUT 5········· 'contestant #1 lamp
OUTPUT 7········· 'contestant #2 lamp
OUTPUT 9········· 'contestant #3 lamp
main:
OUT0 = IN1······· 'set buzzer to switch emcee switch
OUT5 = IN11······ 'set lamp 1 to switch 1
OUT7 = IN13······ 'set lamp 2 to switch 2
OUT9 = IN15······ 'set lamp 3 to switch 3
'DEBUG ? IN1
DEBUG ? IN13
DEBUG ? IN15
DEBUG ? IN11
DEBUG ? OUT3
IF IN1 = 1 THEN·· 'ring buzzer to alert emcee
OUT0 =1
PAUSE 2000
OUT0 = 0
PAUSE 2000
ENDIF
IF IN11 = 1 THEN·· 'ring buzzer to alert emcee
OUT3 =1
OUT5 =1
PAUSE 2000
OUT3 = 0
OUT5 = 0
PAUSE 2000
ENDIF
IF IN13 = 1 THEN·· 'ring buzzer to alert emcee
OUT3 = 1
OUT7 = 1
PAUSE 2000
OUT3 = 0
OUT7 = 0
PAUSE 2000
ENDIF
IF IN15 = 1 THEN·· 'ring buzzer to alert emcee
OUT3 = 1
OUT9 = 1
PAUSE 2000
OUT3 = 0
OUT9 = 0
PAUSE 2000
ENDIF
'PAUSE 500········ 'short pause
GOTO main········ 'start over
Comments
getting the switches to lock each other out.