trinket analog joystick help

Adafruit's tiny microcontroller platform. Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
MichaelDot
 
Posts: 4
Joined: Sat Oct 18, 2014 4:23 pm

trinket analog joystick help

Post by MichaelDot »

I can get buttons and mouse input to work. But I cant find any examples from anyone explaining the way to set up a joystick. I can find it for everything else in the world of avr. Please, im racking my brain on this and I would appreciate any help.

I am attempting to use two pots to as analog axis on a gamepad. Really im using an old rc controller and using the wheel and throttle controllers as an input for a driving game im developing for the oculus rift.

User avatar
p0ke
 
Posts: 33
Joined: Fri Oct 10, 2014 5:03 pm

Re: trinket analog joystick help

Post by p0ke »

Hmm... remembered that Arduino example here:
http://www.arduino.cc/en/Tutorial/JoyStick
Could this be an entry for your case?

User avatar
adafruit_support_bill
 
Posts: 88138
Joined: Sat Feb 07, 2009 10:11 am

Re: trinket analog joystick help

Post by adafruit_support_bill »

The Arduino example is relevant here. The only catch is the limited number of pins on the trinket. Since two of the three analog pins are shared by the USB, you may need to disconnect your joystick when uploading code.

User avatar
MichaelDot
 
Posts: 4
Joined: Sat Oct 18, 2014 4:23 pm

Re: trinket analog joystick help

Post by MichaelDot »

That may be my problem. Thanks.

User avatar
adafruit_support_bill
 
Posts: 88138
Joined: Sat Feb 07, 2009 10:11 am

Re: trinket analog joystick help

Post by adafruit_support_bill »

You might want to consider the Trinket Pro. It is slightly bigger, but has a lot more pins to work with.
https://www.adafruit.com/search?q=trinket+pro&b=1

User avatar
MichaelDot
 
Posts: 4
Joined: Sat Oct 18, 2014 4:23 pm

Re: trinket analog joystick help

Post by MichaelDot »

I guess I didn't mention that I wanted this to act as an HID joystick. Is that relevant here? what library would I use for the HID joystick? Also, I didn't even know a trinket pro existed. I will have to order one of those to play with.

User avatar
p0ke
 
Posts: 33
Joined: Fri Oct 10, 2014 5:03 pm

Re: trinket analog joystick help

Post by p0ke »

I have no experiences with a joystick yet, but take a look at this article:
https://learn.adafruit.com/trinket-fake ... lternative

Made my first steps with HID using this and it works really good!

User avatar
MichaelDot
 
Posts: 4
Joined: Sat Oct 18, 2014 4:23 pm

Re: trinket analog joystick help

Post by MichaelDot »

thanks for the suggestion. But that is a processing program is an in between for serial terminal on the pc. I guess what I need to do now is really learn vusb. I just thought I would ask if anyone has a joystick library already. VUSB seems like something I need to learn anyway. But I have read through it enough times to realize I would need to devote a week of playing with it to fully understand whats going on and I have limited time right now. I just wanted to create a quick peripheral for my game. I have a leonardo working with my joystick input, but wanted something small. Really small. The 32u4 has multiple tutorials on how to implement an HID joystick. The trinket is so small though. Bummer.

User avatar
adafruit_support_bill
 
Posts: 88138
Joined: Sat Feb 07, 2009 10:11 am

Re: trinket analog joystick help

Post by adafruit_support_bill »

It looks like there are several joystick projects here: http://www.obdev.com/products/vusb/prjall-de.html

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

Return to “Trinket ATTiny, Trinket M0”