Joystick / Analog->Digital Help (Trinket / EZKEY)

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
PeterKoj
 
Posts: 9
Joined: Tue Mar 10, 2015 2:29 pm

Joystick / Analog->Digital Help (Trinket / EZKEY)

Post by PeterKoj »

Hi All,

I recently purchased the EZfruit HID EZ-Key: https://www.adafruit.com/products/1535

and I want to hook up an analog joystick to the EZ-KEY, this joystick: https://www.adafruit.com/products/512.

I did some reading on this forum and understand that I need an ADC (analog to digital converter), and I read further that I could use the trinket http://www.adafruit.com/products/1501 to accomplish this.

I've gotten most of my info from this thread: viewtopic.php?f=8&t=50877

My main questions are as follows:
1) In that thread the original poster said he hooked his joystick up to an arduino, does this mean I'll need more than the Trinket + Ezfruit EZKey to get the effect I need?

2) I haven't coded since college, mostly because I make 3d game art for a living, so are there any code links you can send me that will help me get the Trinket+EZkey talking to each other properly? So far I know I have to map the 1023 analog levels to between -127..127.

3) Does the trinket have the required number of analog input to work with a 2 axis joystick? how about a 3-axis joystick?

4) is there a smarter way to do this?

Thank you in advance for your time and consideration.
- Peter

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: Joystick / Analog->Digital Help (Trinket / EZKEY)

Post by adafruit_support_mike »

This tutorial shows how to connect a Trinket to the joystick: https://learn.adafruit.com/pro-trinket-usb-hid-mouse

This one uses an EZ-Link with a joystick: https://learn.adafruit.com/bluetooth-ar ... k/overview I think the joystick just gives digital up/down/left/right signals, but you get information about how to set up the EZ-Link.

User avatar
PeterKoj
 
Posts: 9
Joined: Tue Mar 10, 2015 2:29 pm

Re: Joystick / Analog->Digital Help (Trinket / EZKEY)

Post by PeterKoj »

Hi Mike,

Thanks for the answer. I can't use the joystick outlined below as it's too big. I need to use this one for it's size , and the "select" button when pressed down: https://www.adafruit.com/products/512

Since that one's analog, I'm wondering if there's a way to go from that analog signal to something the EZ-Key can understand. thoughts?

- Peter

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: Joystick / Analog->Digital Help (Trinket / EZKEY)

Post by adafruit_support_mike »

The Trinket has three analog input channels, so you can test each of them to get readings from different analog sources.

Converting those readings to something the EZ-Key can transmit will be more of a challenge. You'll need to decide what kinds of signals you want to send (key presses or mouse events), then map the values you want to receive to the values you'll get from an ADC reading the joystick outputs.

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”