Shop OBEX P1 Docs P2 Docs Learn Events
Dual-Axis Joystick w/ Basic Stamp — Parallax Forums

Dual-Axis Joystick w/ Basic Stamp

Dan TaylorDan Taylor Posts: 207
edited 2010-05-10 17:40 in BASIC Stamp
I purchased the Daul-Axis Joystick from the website· and ran the test program. Now I am having problems getting results from tilting both directions. Tilting to the·up position and to the right I will get a 1 on the different variables, but in any other case the both return with 0. How can I tell if it is tilted back or to the left if it returns the same as if it is not tilted.

Also can it return a Analog signal? So that I could vary the speed of my Boe-Bot based on how far the joystick is tilted.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Dan Taylor

Comments

  • FranklinFranklin Posts: 4,747
    edited 2010-05-07 01:59
    It is returning an analog signal. Could you ATTACH your program to a post for help? Also how you have it connected.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • Dan TaylorDan Taylor Posts: 207
    edited 2010-05-07 05:52
    Here is the code. Straight from the documentation:·

    HIGH 1
    · PAUSE 2
    · RCTIME 1, 1, UD

    · HIGH 0
    · PAUSE 2
    · RCTIME 0, 1, LR

    · DEBUG HOME, "UD =· ", DEC UD, CLREOL, CR,
    ············· "LR =· ", DEC LR, CLREOL
    · PAUSE 50

    ·I have it connected just as it says in the documentation. VDD, VSS, and the U/D to pin 1 and the L/R to pin 0.





    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dan Taylor
  • FranklinFranklin Posts: 4,747
    edited 2010-05-07 14:39
    That's not all the code because you don't have the variables defined or processor selected. Why don't you ATTACH your code to your next post using the attachment manager form the 'post reply' button? Thanks

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • Dan TaylorDan Taylor Posts: 207
    edited 2010-05-07 17:34
    There is the entire code. Its a little easier to post in the post rather than attach the entire thing to the post. The beginning of the program is somewhat basic.

    Thanks for any·insight that you can give.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dan Taylor
  • FranklinFranklin Posts: 4,747
    edited 2010-05-08 03:44
    What do you get when you run the program and wiggle the stick?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • Dan TaylorDan Taylor Posts: 207
    edited 2010-05-08 18:08
    When it is tilted up, I get a 1 in the U/D variable. And when I tilt it to the right I get a 1 in the R/L variable. Everything else returns with a 0 in both variables.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dan Taylor
  • FranklinFranklin Posts: 4,747
    edited 2010-05-08 19:12
    How do you have it all connected? what value caps are you using?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • Dan TaylorDan Taylor Posts: 207
    edited 2010-05-09 04:03
    Everything is connected to the right ports and all. No resistors are being used. Just a straight connection from the joystick's outputs to pins.

    Not using any capacitors right now either. (If thats what you meant by value caps.) Is that what I need to incorporate·for this to work?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dan Taylor
  • W9GFOW9GFO Posts: 4,010
    edited 2010-05-09 05:30
    Dan Taylor said...
    Everything is connected to the right ports and all. No resistors are being used. Just a straight connection from the joystick's outputs to pins.

    Not using any capacitors right now either. (If thats what you meant by value caps.) Is that what I need to incorporate for this to work?

    Yup!

    Look at page 151 of What's a Microcontroller.

    Rich H

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    The Simple Servo Tester, a kit from Gadget Gangster.
  • Dan TaylorDan Taylor Posts: 207
    edited 2010-05-09 16:24
    Awesome! Its working great. For some reason I thought I didn't have to build to circuit for it to work. [noparse];)[/noparse]
    Thanks for your help with this!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dan Taylor
  • Dan TaylorDan Taylor Posts: 207
    edited 2010-05-10 03:35
    Oppsss... ran into another problem. The center value is roughly about 170 for both variable resistors. The problem is that whethe tilting forward, back, right, left, it will always decrease that number. So I can not tell the difference between a tilt forward and a tilt backward. And I also can't tell the difference between the tilt right and the tilt left.
    What do I do?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dan Taylor

    Post Edited (Dan Taylor) : 5/10/2010 4:21:24 AM GMT
  • W9GFOW9GFO Posts: 4,010
    edited 2010-05-10 04:19
    Make sure that it is hooked up correctly.

    www.parallax.com/Portals/0/Downloads/docs/prod/sens/27800-2-AxisJoyStick-v1.0.pdf

    Rich H

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    The Simple Servo Tester, a kit from Gadget Gangster.
  • Dan TaylorDan Taylor Posts: 207
    edited 2010-05-10 17:40
    Thanks. I had the U/D+ and L/R+ connected to VDD.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dan Taylor
Sign In or Register to comment.