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.
trinket analog joystick help
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- p0ke
- Posts: 33
- Joined: Fri Oct 10, 2014 5:03 pm
Re: trinket analog joystick help
Hmm... remembered that Arduino example here:
http://www.arduino.cc/en/Tutorial/JoyStick
Could this be an entry for your case?
http://www.arduino.cc/en/Tutorial/JoyStick
Could this be an entry for your case?
- adafruit_support_bill
- Posts: 88138
- Joined: Sat Feb 07, 2009 10:11 am
Re: trinket analog joystick help
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.
- MichaelDot
- Posts: 4
- Joined: Sat Oct 18, 2014 4:23 pm
Re: trinket analog joystick help
That may be my problem. Thanks.
- adafruit_support_bill
- Posts: 88138
- Joined: Sat Feb 07, 2009 10:11 am
Re: trinket analog joystick help
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
https://www.adafruit.com/search?q=trinket+pro&b=1
- MichaelDot
- Posts: 4
- Joined: Sat Oct 18, 2014 4:23 pm
Re: trinket analog joystick help
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.
- p0ke
- Posts: 33
- Joined: Fri Oct 10, 2014 5:03 pm
Re: trinket analog joystick help
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!
https://learn.adafruit.com/trinket-fake ... lternative
Made my first steps with HID using this and it works really good!
- MichaelDot
- Posts: 4
- Joined: Sat Oct 18, 2014 4:23 pm
Re: trinket analog joystick help
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.
- adafruit_support_bill
- Posts: 88138
- Joined: Sat Feb 07, 2009 10:11 am
Re: trinket analog joystick help
It looks like there are several joystick projects here: http://www.obdev.com/products/vusb/prjall-de.html
Please be positive and constructive with your questions and comments.