Teensy++2.0 Joystick help. 8 axis, many buttons.

Status
Not open for further replies.

Djinny

Member
Edit: Can skip to my 5th post.

To summarize what i'm working on. I need help getting additional Axis to work on the Teensy++2.0
I tweaked the descriptor and the usb_api.h file, as well as the others. The code compiles, the 8 axis and 32 buttons show up, i removed the hats cause i won't need them. And then nothing, the joysticks don't move. Post #5 has my more updated code and such. Maybe you can figure it out, i sure can't.


Thank you
 
Last edited:
have you seen this thread?

can you get one joystic working using the default descriptors? ...what does joy.cpl look like (u on windows)
 
Last edited:
Edit: Skip to Post #5

Alright, I can't seem to get this to work. I'll upload what i have so far. If anyone can figure out what the heck is wrong. Please tell me.
Right now, every time i set the axis to 8(total) it stops on me.

My goal is, i need eight 10bit axis, and 32buttons, and 6 keyboard keys,(#1-6)
And this is what i got so far.. But i'm going to start pulling hair out on this.
 
Last edited:
Edit: Post #5 has more updated files, but still no solution.

Updated my previous post, since this is frustrating me to no end. I went with the more expensive Teensy to be easy to work with. But adding 2 more axis is proving to be tough.

Update again:
I managed to get all 8 axis to show up in joy.cpl, BUT they do nothing. I removed the hats and redid the bit shifting in usb_api.h
This way it uses 16 bytes, (0-15), and completely fills them. I don't need or want hats on this particular teensy configuration anyways.

I still can't get it to work. I think the problem is in usb.c, I'm not sure if it's my joystick_desc_offset, or my hex values after joystick_report_data[11] = 0x80; so for 12-15
But at least it shows up now!

In the attached file is my usb_hid folder for inside the teensy core, as well as my INO file.
i'm using arduino IDE 1.6.5
Please help me with this, i been working on it for a few days and i know i'm getting closer, but i'm still not there yet. :( my $5 arduino leonardo with leojoy can support 8 axis, so why can't teensy?
 
Last edited:
Anyone understand how the JOYSTICK_HID_DESC_OFFSET, in usb.c is calculated?
For example, it's #define JOYSTICK_HID_DESC_OFFSET ( 9 + 9+9+7 + 9+9+7 + 9+9+7+7 + 9 )
by default.

Or these, the bold parts are new.
Code:
#ifdef JOYSTICK_INTERFACE
	joystick_report_data[0] = 0;
	joystick_report_data[1] = 0;
	joystick_report_data[2] = 0;
	joystick_report_data[3] = 0;
	joystick_report_data[4] =  0x0F; // 15
	joystick_report_data[5] =  0x20; // 32
	joystick_report_data[6] =  0x80; // 128
	joystick_report_data[7] =  0x00; // 0
	joystick_report_data[8] =  0x02; // 2
	joystick_report_data[9] =  0x08; // 8
	joystick_report_data[10] = 0x20; // 32
	joystick_report_data[11] = 0x80; // 128
[b]	joystick_report_data[12] = 0x00; //--12-15 new, not sure how to set them
	joystick_report_data[13] = 0x02;
	joystick_report_data[14] = 0x08;[/b]
Seriously, i been trying to get this to work for days now. Nothing i seem to try works.

Redit: added are my latest-latest files. Still not working, but fixed a lot of errors.
rerere-edit, i found even more codes, so on version 8.18, still doesn't work, but i corrected a lot of crap.
 

Attachments

  • SBTeensy2.0_plus_plus.ino
    9.4 KB · Views: 71
  • usb_hid8.18.zip
    15.4 KB · Views: 96
Last edited:
Status
Not open for further replies.
Back
Top