XIM Community

N52te and Orbweaver internals replaced by Teensy  (Read 17867 times)

Offline Au1d Yin

  • MVP
  • *
  • Posts: 578
    • View Profile
Re: N52te internals replaced by Teensy
« Reply #60 on: 11:45 AM - 09/03/15 »
Here is for joystick buttons:
Code: [Select]
void setup()
{
   Joystick.useManualSend(true);

   pinMode(0, INPUT_PULLUP);
   pinMode(1, INPUT_PULLUP);
   pinMode(2, INPUT_PULLUP);
   pinMode(3, INPUT_PULLUP);
   pinMode(4, INPUT_PULLUP);
   pinMode(5, INPUT_PULLUP);
   pinMode(6, INPUT_PULLUP);
   pinMode(7, INPUT_PULLUP);
   pinMode(8, INPUT_PULLUP);
   pinMode(9, INPUT_PULLUP);
   pinMode(10, INPUT_PULLUP);
   pinMode(11, INPUT_PULLUP);
   pinMode(12, INPUT_PULLUP);
   pinMode(24, INPUT_PULLUP);
   pinMode(25, INPUT_PULLUP);
   pinMode(26, INPUT_PULLUP);
   pinMode(27, INPUT_PULLUP);
   pinMode(28, INPUT_PULLUP);
}
void loop() {

   Joystick.button(1, !digitalRead(2));
   Joystick.button(2, !digitalRead(3));
   Joystick.button(3, !digitalRead(4));
   Joystick.button(4, !digitalRead(5));
   Joystick.button(5, !digitalRead(6));
   Joystick.button(6, !digitalRead(7));
   Joystick.button(7, !digitalRead();
   Joystick.button(8, !digitalRead(9));
   Joystick.button(9, !digitalRead(10));
   Joystick.button(10, !digitalRead(11));
   Joystick.button(11, !digitalRead(12));
   Joystick.button(12, !digitalRead(24));
   Joystick.button(13, !digitalRead(25));
   Joystick.button(14, !digitalRead(26));
   Joystick.button(15, !digitalRead(27));
   Joystick.button(16, !digitalRead(28));

   Joystick.X(analogRead(0));
   Joystick.Y(analogRead(1));

   if(touchRead(18) > 3000) Joystick.button(17, 1);
   else Joystick.button(17, 0);
   if(touchRead(19) > 3000) Joystick.button(18, 1);
   else Joystick.button(18, 0);

   Joystick.send_now();
}
Use with VER2 (G13) code.

I will need to check later if joystick, mouse and kb are possible at the same time with xim4e now that it supports composite devices.

About the NKRO6: Kb buttons have it, but joystick buttons does not have that limit.

btw: Knew it was the code, but was just hoping it still would work. Would have saved me from some coding and testing...


W11cE, I've used this code in my Teensy and wired it up and it's tested out ok and working.

I have joystick buttons 1 -16 tested as working but I'm a bit confused at buttons 17 & 18 ... are they coded as touch only ?

I'll be ok with 16 buttons, I'm just trying to figure out how it all works, and I can't understand the setup of those 2 buttons.

Thanks for all the work you put into this ... awesome job :)

Offline W11cE

  • MVP
  • *
  • Posts: 1523
    • View Profile
Re: N52te and Orbweaver internals replaced by Teensy
« Reply #61 on: 12:17 PM - 09/03/15 »
We have 36 buttons we can use any way we want. Here those are coded for touch and also the threshold value would need to be changed if you want to use those.
You are welcome :)

Offline Au1d Yin

  • MVP
  • *
  • Posts: 578
    • View Profile
Re: N52te and Orbweaver internals replaced by Teensy
« Reply #62 on: 02:05 PM - 09/03/15 »
We have 36 buttons we can use any way we want. Here those are coded for touch and also the threshold value would need to be changed if you want to use those.
You are welcome :)

Thanks ... so I take it I am right in assuming that only 16 joystick buttons can be wired to cherry switches, (in the code I used) without changing any codes ... not that I can, or want to, just trying to understand it all.

Offline ak-xs

  • MVP
  • *
  • Posts: 6514
  • I'm what you call a player of non sens xD
    • View Profile
    • don't click here!
Re: N52te and Orbweaver internals replaced by Teensy
« Reply #63 on: 09:11 AM - 09/05/15 »
this has gotten quite impressive for people who never saw it before, i think it could be quite loved even outside xim forums..
soon..

Offline W11cE

  • MVP
  • *
  • Posts: 1523
    • View Profile
Re: N52te and Orbweaver internals replaced by Teensy
« Reply #64 on: 12:40 PM - 09/05/15 »
Thanks ... so I take it I am right in assuming that only 16 joystick buttons can be wired to cherry switches, (in the code I used) without changing any codes ... not that I can, or want to, just trying to understand it all.

Well, just add these there and you can use another button:
Code: [Select]
pinMode(14, INPUT_PULLUP);
Joystick.button(17, !digitalRead(14));

this has gotten quite impressive for people who never saw it before, i think it could be quite loved even outside xim forums..
Original idea wasnt even from here. And this has been silent for a quite long time.

Offline ak-xs

  • MVP
  • *
  • Posts: 6514
  • I'm what you call a player of non sens xD
    • View Profile
    • don't click here!
Re: N52te and Orbweaver internals replaced by Teensy
« Reply #65 on: 04:44 PM - 09/05/15 »
this is the 4th time you tell me that, i know xD
and i can see that from the time stamps, but i showed it to someone and they found it very interesting. i think there are similar ventures elsewhere too, but this one is elegant due to what makes the n52/orb interesting.

also your code allows for changes and additions. it might be useful for VR if the fancy new tech controllers take long to spread. STEM is still months away, for years now, Valve is making something new, as is Oculus.. passthrough video is cool but intuitive form factors for controllers are beginning to matter again for me..
soon..

Offline Au1d Yin

  • MVP
  • *
  • Posts: 578
    • View Profile
Re: N52te and Orbweaver internals replaced by Teensy
« Reply #66 on: 04:30 AM - 09/07/15 »
Thanks ... so I take it I am right in assuming that only 16 joystick buttons can be wired to cherry switches, (in the code I used) without changing any codes ... not that I can, or want to, just trying to understand it all.

Well, just add these there and you can use another button:
Code: [Select]
pinMode(14, INPUT_PULLUP);
Joystick.button(17, !digitalRead(14));



Thanks for that but I  wouldn't have a clue on how to go about adding to a code lol.

I'm building a Keypad/mousemat frame that will sit on a desk or take removable legs that will let it be used while sitting on a sofa.

There's lots of room inside the framework that will let me add the pcb of my old modded Belkin N52te with a hub if I need more switches  (probably to foot pedals)

Will post pics when it's done ... got a new force feed back racing wheel delivered and it's keeping me away from it  :)

Offline gduck24

  • Member
  • *
  • Posts: 360
    • View Profile
    • Make Mod Hack
  • Gamertag: grayskuii
Re: N52te internals replaced by Teensy
« Reply #67 on: 10:32 AM - 07/29/19 »
Here is for joystick buttons:
Code: [Select]
void setup()
{
Joystick.useManualSend(true);

pinMode(0, INPUT_PULLUP);
pinMode(1, INPUT_PULLUP);
pinMode(2, INPUT_PULLUP);
pinMode(3, INPUT_PULLUP);
pinMode(4, INPUT_PULLUP);
pinMode(5, INPUT_PULLUP);
pinMode(6, INPUT_PULLUP);
pinMode(7, INPUT_PULLUP);
pinMode(8, INPUT_PULLUP);
pinMode(9, INPUT_PULLUP);
pinMode(10, INPUT_PULLUP);
pinMode(11, INPUT_PULLUP);
pinMode(12, INPUT_PULLUP);
pinMode(24, INPUT_PULLUP);
pinMode(25, INPUT_PULLUP);
pinMode(26, INPUT_PULLUP);
pinMode(27, INPUT_PULLUP);
pinMode(28, INPUT_PULLUP);
}
void loop() {

Joystick.button(1, !digitalRead(2));
Joystick.button(2, !digitalRead(3));
Joystick.button(3, !digitalRead(4));
Joystick.button(4, !digitalRead(5));
Joystick.button(5, !digitalRead(6));
Joystick.button(6, !digitalRead(7));
Joystick.button(7, !digitalRead(8));
Joystick.button(8, !digitalRead(9));
Joystick.button(9, !digitalRead(10));
Joystick.button(10, !digitalRead(11));
Joystick.button(11, !digitalRead(12));
Joystick.button(12, !digitalRead(24));
Joystick.button(13, !digitalRead(25));
Joystick.button(14, !digitalRead(26));
Joystick.button(15, !digitalRead(27));
Joystick.button(16, !digitalRead(28));

Joystick.X(analogRead(0));
Joystick.Y(analogRead(1));

if(touchRead(18) > 3000) Joystick.button(17, 1);
else Joystick.button(17, 0);
if(touchRead(19) > 3000) Joystick.button(18, 1);
else Joystick.button(18, 0);

Joystick.send_now();
}
Use with VER2 (G13) code.

I will need to check later if joystick, mouse and kb are possible at the same time with xim4e now that it supports composite devices.

About the NKRO6: Kb buttons have it, but joystick buttons does not have that limit.

btw: Knew it was the code, but was just hoping it still would work. Would have saved me from some coding and testing...

I am still using this same code on my teensy orbweaver as originally posted.  Now that Xbox allows keyboad and mouse on some games I would like to see if I can make this work with keyboard keys instead of joystick buttons for native support.  Has anybody tried this yet?  Any idea what mods on the code would need to be made?  I have a feeling I will lose the analog input if I just change to a usb keyboard by teensy.


If the best I could do was get to where I can get it to work as a keyboard only without analog on native, but working with the analog and keyboard with XIM that would be good enough.  Trying to play minecraft and I dont want to have to change my setup for just those games.
« Last Edit: 10:36 AM - 07/29/19 by gduck24 »
I gotta quit welding in flip flops...