Copyright © Parallax Inc.
Page 2 of 4
Basic Wiring
•
Power requirements: 3.3 to 5 VDC (typical); set supply voltage for compatibility with the input of
your microcontroller
•
Communication: Single bit HIGH/LOW output for each position
•
Dimensions: 0.70 x 0.95 x 0.78 in (17.8 x 24.1 x 19.8 mm)
Program KickStarts
The example programs display the current state of the switch in a terminal/debug window. The
switch function — such as Up or Left — is shown. The program is set to repeat indefinitely.
BASIC Stamp HomeWork Board
' {$STAMP BS2}
' {$PBASIC 2.5}
DO
IF (IN0 = 0) THEN DEBUG "Left", CR
IF (IN1 = 0) THEN DEBUG "Down", CR
IF (IN2 = 0) THEN DEBUG "Right", CR
IF (IN3 = 0) THEN DEBUG "Center", CR
IF (IN4 = 0) THEN DEBUG "Up", CR
PAUSE 200
LOOP
Note:
When this program is run, the BASIC Stamp Debug Terminal will automatically open.