Adafruit Thumb Joystick Select Button behavior

Breakout boards, sensors, Drawdio, Game of Life, other Adafruit kits, etc.

Moderators: adafruit_support_bill, adafruit

Adafruit Thumb Joystick Select Button behavior

Postby jnimtz » Fri Jun 01, 2012 3:41 pm

I'm experiencing a strange behavior with the Adafruit Analog 2-axis Thumb Joystick with Select Button + Breakout Board (https://www.adafruit.com/products/512).

Background Info:
I'm using this on a SegBot project (Segway-style self-balancing vehicle) for two purposes:
When the SegBot is not auto-balancing/driving (mostly level), the Y-axis (up/down) will be used to navigate for a menu system to manage user preferences (displayed on Adafruit's Negative RGB LCD, and stored on an SD card using Adafruit's Logger Shield). The select button (pushing stick in) will be used to select whatever option is currently selected.

The second purpose will be when the SegBot is actually driving, and the X-axis will be used for differential steering changes to a motor controller.

Unusual behavior:
When I only connect the Thumb Joystick to the Arduino (Uno) according to the Arduino button example, and/or LadyAda's Debounce example, the select button works as expected. However, if I move the Thumb Joystick to any extreme (+/- X or Y axis), while be very intentional to not push the stick in, it also appears to close the select button (short to GND).

Question:
Is this normal (expected) behavior, or something wrong with the Thumb Joystick product?
Also, if this is normal behavior, should I just code around it with a longer debounce threshold (like 500ms) to make sure you are really holding the stick in to select what you want, and/or make sure that X/Y are very low (closer to 0) before deciding that you really pushed the button? I'm sure I'll need to have a way to switch between "Driving Mode" and "Configuration Mode", but I was just wondering whether the Select button behavior was normal/expected.

Any input you can provide would be greatly appreciated.
jnimtz
 
Posts: 2
Joined: Thu Dec 22, 2011 4:31 pm

Re: Adafruit Thumb Joystick Select Button behavior

Postby adafruit » Fri Jun 01, 2012 8:12 pm

you can look at the switch, also are you using a pullup?
User avatar
adafruit
 
Posts: 10491
Joined: Thu Apr 06, 2006 3:21 pm
Location: nyc

Re: Adafruit Thumb Joystick Select Button behavior

Postby jnimtz » Sat Jun 02, 2012 1:44 am

Thanks for the prompt reply.
Everything is working correctly now. Feel free to skip over my ramblings below.

Anyway, thanks for all the awesome gadgets you all create & sell, your patience with my verbose narratives, and most importantly, providing excellent and timely support to your customers and the community. Your time, skills, and passion are very valuable, and I appreciate your willingness to share them with all of us.


Details:
Turns out I made quite the rookie mistake, but your reply prompted me to verify that I was using a pullup resistor.
I was actually configured using a pulldown resistor, which appeared to be working, but didn't make sense the more I thought about it (as the breakout board clearly states that SEL shorts to GND when pressed).

I was trying to get one component working, and then incrementally add each additional component in turn.
I had the RGB LCD working (with its own sketch), and I added the wiring for the Thumbstick, and was only using the Debounce code example before integrating it into the other sketch.

However, when I added the wiring for the Thumbstick to the already wired LCD, I wasn't consistant with my color choices.
I'm using 4-wire intercom wiring from RadioShack for my longer runs, and its wires are Green-Red-Black-White.

On the RGB LCD (with i2c backpack), I have Red=Vcc, Black=GND, Green=DAT, White=CLK.
A second length of wire uses Red-Green-Black, and they are connected directly to the last 3 pins on the RGB LCD for Red-Green-Blue (backlight) control.

When I added the Thumbstick, I cut a section of Red-Green to wire into the breakout board as Red=Vcc, Green=GND (and unrelated, but a section of Black/White and a single White, where Black=SEL, White1=X, White2=Y).

So when I went to tie in a short run from the Thumbstick's Vcc/GND to the RGB LCD (which has the longer run), I connected Red to Red (okay), and Green to Green (which was the DAT connection, not GND). So whatever I was connecting to, certainly wasn't GND, and was probably a floating input (undefined in the debounce sketch), and it was reading HIGH, and my pulldown resistor configuration appeared to be working.

A continuity test on the Thumbstick breakout showed some resistance between Vcc & Ground when SEL was open, and full continuity when closed, so I'm sure my Arduino probably didn't appreciate that.

After getting your reply, I had to figure this out before going to bed, as I wouldn't be able to sleep knowing I couldn't get the simple button example working. :lol:

Tomorrow I'll redo the button wiring with Red/Black so I'm not totally confused when I have to make a change 6 months from now!

Thanks again!
jnimtz
 
Posts: 2
Joined: Thu Dec 22, 2011 4:31 pm


Return to Other Adafruit products

Who is online

Users browsing this forum: No registered users and 4 guests

Stuff to buy from the Adafruit store and links to product documentation!


New Products [107]

Raspberry Pi[80]
 
FLORA[23]
 
Bunnie Studios[9]
 
FPGA[1]
 
mbed[11]
Arduino[60]
 
NETduino[14]
 
BeagleBone[24]
 
Android[6]
 
XBee[10]
More Dev Boards[31]


 
BoArduino[8]
 
SpokePOV[4]
 
TV-B-Gone[4]
 
MiniPOV[3]
 
SIM reader[3]
 
Microtouch[5]
 
Clocks & Watches[18]
 
Drawdio[4]
 
Brain Machine[1]
 
Game of Life[2]
 
MintyBoost[2]
More DIY Kits[16]


 
MaKey MaKey[3]
 
Tweet-a-Watt[5]
 
Young Engineers[33]
 
Discover Electronics[2]
 
Snap Circuits[4]
 
littleBits[3]
 
Project packs[8]


 
Breakout Boards[33]
LCDs & Displays[48]
Components & Parts[70]
Batteries & Power[49]
EL Wire/Tape/Panel[52]
LEDs[111]
 
Wireless[14]
Cables[62]
 
Lasers[6]
Sensors/Parts[145]
 
Enclosures/Cases[11]
 
Solar[11]
 
RFID / NFC[13]
Prototyping[70]
 
iDevices[13]
Tools[71]
 
Wearables[39]
 
CNC[37]
 
Robotics[29]
 
3D printing[1]
 
Materials[24]


 
Stickers[41]
 
Skill badges[55]
 
Books[25]
 
Circuit Playground[7]
 
Gift Certificates[4]