Shop OBEX P1 Docs P2 Docs Learn Events
Using a WIRED joystick — Parallax Forums

Using a WIRED joystick

zmasterfunzmasterfun Posts: 14
edited 2008-05-01 01:53 in BASIC Stamp
··· So I have a wired joystick and i can't figure out how to hook it up or program it.· Red wire is ground and the·other wires are potenometers.· Please help soon

thank you in advance!smile.gif

EDIT: so far i have

' {$STAMP BS2} 
' {$PBASIC 2.5} 
store VAR Word 

DO 

HIGH 3 
PAUSE 10 
RCTIME 7 , 1 , store 
DEBUG DEC store 
LOOP

debug is· 111111111111111111111111111111111...

Post Edited (zmasterfun) : 4/29/2008 6:00:55 PM GMT

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-04-29 17:54
    Look at the BASIC Stamp Manual in the chapter on the RCTIME statement. It shows how to measure an unknown resistance (the joystick potentiometers) using a small capacitor and the Stamp.
  • zmasterfunzmasterfun Posts: 14
    edited 2008-04-29 18:09
    Tried the manual.
    ·i just get:·
    result = 1

    Post Edited (zmasterfun) : 4/29/2008 6:20:18 PM GMT
  • Paul Sr.Paul Sr. Posts: 435
    edited 2008-04-29 18:16
    Please post your schematic.
  • zmasterfunzmasterfun Posts: 14
    edited 2008-04-29 18:26
    Schematic
  • Paul Sr.Paul Sr. Posts: 435
    edited 2008-04-29 19:14
    RCTIME statement is referencing PIN 7

    Your schematic is missing resistors

    Follow Mike's instructions!

    Post Edited (Paul Sr.) : 4/29/2008 7:19:24 PM GMT
  • zmasterfunzmasterfun Posts: 14
    edited 2008-04-29 19:35
    Put in resistors and changed code and wires to pin 7

    still getting result = 1
  • FranklinFranklin Posts: 4,747
    edited 2008-04-29 19:41
    What values are you using and what is the resistance range the joystick is putting out?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • Mike GreenMike Green Posts: 23,101
    edited 2008-04-29 19:57
    You're missing the small (220 Ohm) resistor in series with the Stamp pin which prevents the Stamp from damage. You don't provide the value of the capacitor. It's an electrolytic and the + terminal should not be connected to Vss (ground). You probably don't need a large electrolytic capacitor anyway. FOLLOW THE DIRECTIONS IN THE MANUAL for choosing a capacitor. You'll need to know the resistance range for the joystick to figure this out.
  • zmasterfunzmasterfun Posts: 14
    edited 2008-04-29 22:15
    i haven't figured out the range yet and i don't understand the manual
  • Mike GreenMike Green Posts: 23,101
    edited 2008-04-29 22:34
    Do you have a multimeter?· RadioShack sells them, some as little as $10.· You need a voltage range and a resistance range.· Anything else is optional.

    As far as the manual is concerned, what specifically don't you understand?· Also, what parts do you understand about the RCTIME statement and how it's used?
  • zmasterfunzmasterfun Posts: 14
    edited 2008-04-30 18:05
    Yes, I have a multimeter.· But how do i wire this?
  • AmaralAmaral Posts: 176
    edited 2008-04-30 20:40
    first things first !

    Take the multimeter and put on the impedance mesurement ! highest range first then you go donw - Pick the common wire of the joistick and one of the other wires that you have ! (if you don't know witch is the commom wire, you may open the joystick and look at it , or try one by one in combination to solve it)

    mesure the resistace of this pair , determ witch command of the joystick you are mesuring, check the highest value , than check the lowest value ! (write that on a paper) and send to us ! (over here)

    see if can do it

    amaral
  • zmasterfunzmasterfun Posts: 14
    edited 2008-05-01 01:32
    Highest resistance is full current blocked and
    ·lowest·resistance·is about 2k· ohms for both x and y values

    Post Edited (zmasterfun) : 5/1/2008 1:43:20 AM GMT
  • zmasterfunzmasterfun Posts: 14
    edited 2008-05-01 01:53
    Update: my joystick now works only if you push it past center in one direction for both x and y each.· So now the question is: how do I make it register for the remaining directions.

    Post Edited (zmasterfun) : 5/1/2008 2:09:28 AM GMT
Sign In or Register to comment.