XIM Community

Tut: Microcontrollers as a HID device(s) on XIM adapters.  (Read 65049 times)

Offline W11cE

  • MVP
  • *
  • Posts: 1525
    • View Profile
The latest version here: 08012016

Install on the top of Arduino IDE 1.6.7 and Teensyduino 1.27


Short description:
This package adds 3 custom USB modes for teensy 3.0, 3.1, 3.2 and LC.
 - Joystick VER 1 is recommended for XIM 3 and EDGE. (Does not work with XIM 4).
 - Joystick VER 2 is for XIM 4.
 - Modified mouse USB mode with support for Aux buttons for XIM 3, 4 and EDGE.


Joystick VER 1
Code: [Select]
Joystick.X(val);
Joystick.Y(val);
Axis values between 0 and 1023.

Code: [Select]
Joystick.Button(button, val);
Joystick.button(button, val);
Button from 1 to 11. Val 1 = pressed, 0 = released.


Joystick VER 2
Code: [Select]
Joystick.X(val);
Joystick.Y(val);
Axis values between 0 and 1023.

Code: [Select]
Joystick.Button(button, val);
Joystick.button(button, val);
Button from 1 to 35. Val 1 = pressed, 0 = released.


Mouse
Code: [Select]
Mouse.X(val);
Mouse.Y(val);
Mouse axis relative movement.

Code: [Select]
Mouse.scroll(val);
Mouse.pan(val);
Use these for scroll direction(0 is centered):
Code: [Select]
SCROLL_UP
SCROLL_DOWN
PAN_LEFT
PAN_RIGHT


Code: [Select]
Mouse.Button(button, val);
Mouse.button(button, val);
Val 1 = pressed, 0 = released. Use these for button names:
Code: [Select]
XIM4_Left
XIM4_Right
XIM4_Middle
XIM4_Back
XIM4_Forward
XIM4_Aux1
XIM4_Aux2
XIM4_Aux3
XIM4_Aux4
XIM4_Aux5
XIM4_Aux6
XIM4_Aux7
XIM4_Aux8
XIM4_Aux9
XIM4_Aux10
XIM4_Aux11
« Last Edit: 01:08 AM - 01/08/16 by W11cE »

Offline roads

  • MVP
  • *
  • Posts: 19729
    • View Profile
Re: Tut: Teensy 3.0 as a HID device on XIM3 and Edge (and PC)
« Reply #1 on: 10:42 AM - 01/20/13 »
Congratulations W11ce major breakthrough :D
Will build this right away!
Crusade atm: none

Offline W11cE

  • MVP
  • *
  • Posts: 1525
    • View Profile
Re: Tut: Teensy 3.0 as a HID device on XIM3 and Edge (and PC)
« Reply #2 on: 10:56 AM - 01/20/13 »
Thanks! This has been a real challenge. Gave up few times, but i got it working :)
Is the tutorial enough clear to you? You are a good benchmark for tutorial difficulty  ;D

Offline roads

  • MVP
  • *
  • Posts: 19729
    • View Profile
Re: Tut: Teensy 3.0 as a HID device on XIM3 and Edge (and PC)
« Reply #3 on: 10:59 AM - 01/20/13 »
We need a picture of you W11ce you are officially the Ximmer of the decade this opens a lot of new possibilities. You are awesome! Take this, a bunch of keys, a Joystick and make your own input device!
Add a Joystick to any device no controller needed.
Crusade atm: none

Offline roads

  • MVP
  • *
  • Posts: 19729
    • View Profile
Re: Tut: Teensy 3.0 as a HID device on XIM3 and Edge (and PC)
« Reply #4 on: 11:01 AM - 01/20/13 »
First question, is the middle foot of the potentiometers of  joystick needed? Never saw one of these except in dualshock controllers. Dunno where to get such a joystick. Are these 5000 Ohm each direction?
Crusade atm: none

Offline W11cE

  • MVP
  • *
  • Posts: 1525
    • View Profile
Re: Tut: Teensy 3.0 as a HID device on XIM3 and Edge (and PC)
« Reply #5 on: 11:06 AM - 01/20/13 »
We need a picture of you W11ce you are officially the Ximmer of the decade this opens a lot of new possibilities. You are awesome! Take this, a bunch of keys, a Joystick and make your own input device!
Add a Joystick to any device no controller needed.
Lol. Thanks, but maybe only xim modder of the decade  ;)


First question, is the middle foot of the potentiometers of  joystick needed? Never saw one of these except in dualshock controllers. Dunno where to get such a joystick. Are these 5000 Ohm each direction?

Xbox 360 controller joysticks are all like these. If you mean that leg that connects to yellow wire, then yes it is needed. I think these are 5kOhm each direction. With 3 wire pots it doesnt matter.

Offline roads

  • MVP
  • *
  • Posts: 19729
    • View Profile
Re: Tut: Teensy 3.0 as a HID device on XIM3 and Edge (and PC)
« Reply #6 on: 11:08 AM - 01/20/13 »
Oh long time I did not check then sorry sure three legs :D
Crusade atm: none

Offline roads

  • MVP
  • *
  • Posts: 19729
    • View Profile
Re: Tut: Teensy 3.0 as a HID device on XIM3 and Edge (and PC)
« Reply #7 on: 11:09 AM - 01/20/13 »
Where do you connect the 11 buttons?
Crusade atm: none

Offline OBsIV

  • Administrator
  • MVP
  • *
  • Posts: 37382
  • It's obsessive.
    • View Profile
    • OBsIV's Blog
Re: Tut: Teensy 3.0 as a HID device on XIM3 and Edge (and PC)
« Reply #8 on: 11:10 AM - 01/20/13 »
How many GPIOs does the board have? The reason I ask is because you have gotten pretty close to a device that would sell a lot to the Accessibility community. A device that has a bunch of stereo phone jacks (for connecting Accessibility foot/hand/etc petals) and converts to a USB hid for input into devices like XIM or PC etc.
Get the most out of your XIM APEX, read the XIM APEX Support FAQ.

Offline roads

  • MVP
  • *
  • Posts: 19729
    • View Profile
Re: Tut: Teensy 3.0 as a HID device on XIM3 and Edge (and PC)
« Reply #9 on: 11:16 AM - 01/20/13 »
If you help him mimic the G13 he would have 21(?) buttons? To my understanding this talks as attack 3 Joystick.
Crusade atm: none

Offline W11cE

  • MVP
  • *
  • Posts: 1525
    • View Profile
Re: Tut: Teensy 3.0 as a HID device on XIM3 and Edge (and PC)
« Reply #10 on: 11:30 AM - 01/20/13 »
How many GPIOs does the board have? The reason I ask is because you have gotten pretty close to a device that would sell a lot to the Accessibility community. A device that has a bunch of stereo phone jacks (for connecting Accessibility foot/hand/etc petals) and converts to a USB hid for input into devices like XIM or PC etc.
34 total, 12 can be used as an analog input and 10 as a PWM output.
Yeap, this makes easy conversion from any arduino compatible device to HID. I have some ideas already, just need some time to make those.

Where do you connect the 11 buttons?
It depends on the code. Where do you want those?

If you help him mimic the G13 he would have 21(?) buttons? To my understanding this talks as attack 3 Joystick.
I might not need his help. I already know what to do ;)
And yes this talks like Attack 3. With G13 clone there would be 35 buttons.

Offline Od1n

  • Global Moderator
  • MVP
  • *
  • Posts: 30510
    • View Profile
Re: Tut: Teensy 3.0 as a HID device on XIM3 and Edge (and PC)
« Reply #11 on: 11:54 AM - 01/20/13 »
what exactly is a teensy 3.0? ._.

maybe include that into your tut for noobs like me ;)
PS4 & X1 | C: MS | XIM4 | FW: the latest ofc! :) | Mon: BenQ XL2420Z | Pad: Zowie G-SR | KB: Ducky DK1008L Cherry Red O-Rings| A: AKG K701 Creative X7 Antlion Modmic | M: Zowie EC1-A | D: 3200 | P: 1000hz | BF4 4 HIP: 35 ADS: 20

My Fortnite Creator Code: beamimpact
Check out my Youtube Channel: XIMGameplay

Offline roads

  • MVP
  • *
  • Posts: 19729
    • View Profile
Re: Tut: Teensy 3.0 as a HID device on XIM3 and Edge (and PC)
« Reply #12 on: 11:58 AM - 01/20/13 »
Quote
With G13 clone there would be 35 buttons.

Get to it man this is awesome.

Quote
It depends on the code. Where do you want those?

Dont care just code them somewhere so they work.
Crusade atm: none

Offline roads

  • MVP
  • *
  • Posts: 19729
    • View Profile
Re: Tut: Teensy 3.0 as a HID device on XIM3 and Edge (and PC)
« Reply #13 on: 12:04 PM - 01/20/13 »
Teensy is a programmable controller board Od1n. W11ce for complete noobs you need to draw the picture without the test board.

watch this Odini

http://www.arduino-tutorial.de/
Crusade atm: none

Offline roads

  • MVP
  • *
  • Posts: 19729
    • View Profile
Re: Tut: Teensy 3.0 as a HID device on XIM3 and Edge (and PC)
« Reply #14 on: 12:05 PM - 01/20/13 »
If you code the buttons in I will make my own controller tomorrow W11ce. Have a Teensy 3.0 here already.
Crusade atm: none


Admin