Web Site: www.parallax.com Office: (916) 624-8333 Forums: forums.parallax.com Fax: (916) 624-8003 Sales: sales parallax.com Sales: (888) 512-1024 Technical: support parallax.com Tech Support: (888) 997-8267 5-Position Switch ( 27801) The 5-Position Switch is a normally open contact switch that provides directional output to your project. It has a nice snappy feel, and returns to the center/un-pressed position immediately when it is released. By monitoring the input state of five pins, its easy for any Parallax microcontroller to detect whether the switch is in the up, down, left, right, or pressed position. It is possible for more than one position to make contact at a time, such as pressed+right, left+down, or pressed+right+down, for a total of 18 output states. Features y 8-pin DIP module is ready for breadboard or through- hole projects y 10 k pull-up resistor included on each positional pin y Simple communication with any Parallax microcontroller Key Specifications y Power Requirements: Supply voltage = output signal voltage. Set supply voltage for compatibility with your microcontrollers inputs. y Communication: Single bit high/low output for each position y Operating temperature: 32 to 158 F (0 to +70 C) y Dimensions: 0.70 x 0.95 x 0.78 in (1.78 x 2.41 x 1.98 cm) Application Ideas y Video game input y Robot control Pin Definitions and Ratings Pin Name Function 1 NC No Connection 2 RT Right Contact Switch 3 DN Bottom Contact Switch 4 LT Left Contact Switch 5 VCC Supply Voltage* 6 CTR Center Contact Switch 7 UP Top Contact Switch 8 GND Ground *Supply voltage will determine output voltage. Be sure to use a supply voltage that your microcontroller will tolerate as an input signal. Copyright Parallax Inc. 5-Position Switch ( 27801) v1.1 2/3/2010 Page 1 of 3 Connection Diagram The figure below depicts the connection diagram to use with the included sample programs. Note: 220 resistors may also be placed in series between the 5-Position Switch and the microcontroller I/O pins to prevent potential I/O pin damage from accidental code errors. Source Code These programs are available from the 5-Position Switch product page. Browse to www.parallax.com and Search for 27801. BASIC Stamp 2 Program This program will display the current position of the 5-Position Switch using the Debug Terminal built into the BASIC Stamp Editor, which is available for download from www.parallax.com/basicstampsoftware. STAMP BS2 PBASIC 2.5 DEBUG CLS, Display directional graph , CR, , CR, - - , CR, , CR DO IF (IN0 = 0) THEN DEBUG CRSRXY, 2, 2, ELSE DEBUG CRSRXY, 2, 2, IF (IN1 = 0) THEN DEBUG CRSRXY, 5, 4, ELSE DEBUG CRSRXY, 5, 4, IF (IN2 = 0) THEN DEBUG CRSRXY, 8, 2, ELSE DEBUG CRSRXY, 8, 2, IF (IN3 = 0) THEN DEBUG CRSRXY, 5, 2, ELSE DEBUG CRSRXY, 5, 2, IF (IN4 = 0) THEN DEBUG CRSRXY, 5, 0, ELSE DEBUG CRSRXY, 5, 0, PAUSE 20 LOOP Copyright Parallax Inc. 5-Position Switch ( 27801) v1.1 2/3/2010 Page 2 of 3