Shop OBEX P1 Docs P2 Docs Learn Events
basic stamp — Parallax Forums

basic stamp

marcuzmarcuz Posts: 5
edited 2008-06-30 15:03 in BASIC Stamp
·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

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-06-29 03:28
    You need to include a drawing of your circuit,
  • marcuzmarcuz Posts: 5
    edited 2008-06-30 02:42
    SORRY MIKE NOT ABLE TO ATTACH FILES TRIED TO CUT AND PAST BUT NO GO. IT IS A VERY BASIC CIRCUIT WITH 4 SWITCHES WITH PULL DOWN RESISTORS 220 OHMS AND 10K OHMS AND 3 LEDS WITH 470 OHMS ALL CONNECTED TO VARIOUS PINS. THE SWITCHES I USED FOR MY BUZZER INPUTS AND THE LEDS DISPLAY THE FIRST BUZZER. i COULD EMAIL IT TO YOU IF YOU LIKE>
  • marcuzmarcuz Posts: 5
    edited 2008-06-30 13:43
    ·ok let's try this one. I think this it the proper schematic. I've abandoned the emcee protion of the circuit for now. I'm trying to concentrate on
    getting the switches to lock each other out.
    960 x 720 - 11K
  • Mike GreenMike Green Posts: 23,101
    edited 2008-06-30 15:03
    Look at the schematic in "What's a Microcontroller?" (download link is here: www.parallax.com/tabid/535/Default.aspx) on page 76. Also read the discussion there on pages 75-79. Notice the way the pushbuttons are wired here rather than in your schematic.
Sign In or Register to comment.