Thrustmaster T.Flight Hotas X Teensy MCU mod (USB Flight Joystick/Throttle)

Anyone got links to the attachments mentioned in this thread? Would like to try out this mod and could do with the pin connections on the teensy.
 
The main zip file is in the first post, but looks like some updates further down may be needed to get things working on current Arduino. Looking at the code looks like the key bit for pins are are:
Code:
//Hat pins
#define HU 19
#define HD 20
#define HL 21
#define HR 22

//enable for rudder pedal inputs
#define PEDAL_EN 23

//LED pins
#define LED_GREEN 13
#define LED_RED 14
#define LED_ORANGE 0 //orange is both green and red LEDs, give it a define for the led function
#define LED_PRESET 24
//axis

  x[an_idx]=analogRead(A1);
  y[an_idx]=analogRead(A2);
  z[an_idx]=analogRead(A3);
  rz[an_idx]=analogRead(A4);
  s0[an_idx]=analogRead(A10);
  if (digitalRead(PEDAL_EN)==0)
  {
    rx[an_idx]=analogRead(A11);
    ry[an_idx]=analogRead(A12);
    s1[an_idx]=analogRead(A13);
  }
 
Odd the attachments link isn't clickable for me in that first post. Doesn't matter anyway have worked it all up from scratch and got it working using the joystick complete example as a base.

Need to add some deadzone for the zrotate axis as it has a huge.amount of noise and is sensitive to hand on/off the stick too. Am also going to throw in some kalman filtering for the other analog inputs since there's about 1-2% noise in each axis.
 
Hi Everyone, I like this hack and have wired a 3.2 to my Thrust Master Hotas X but without the 3.2 connected to the computer, I'm unable to verify the code in the IDE. After reading the thread I've inserted gcc as Paul suggested in post #16. I've also double checked my tool settings and the exchange of the 8 files into their proper directories of Arduino. From reading the thread time frame, it looks like problems developed after a certain amount of time. Which makes me wonder if Arduino Version Updates are causing a malfunction. Just a thought. I'm use to looking for patterns in mechanical and electrical malfunctions. I'm not a coder and this is my first time playing with Arduino or Teensy. If anybody has any suggestions I'd appreciate it. My TM Hotas X hack is essential to an extension tube hack I've developed, that places a 12" distance between the joystick base and the joystick handgrip. My Hotas X is mounted in a flight simulation cockpit between the pilot's legs. I've already designed and built all of this, but it's unusable because my TM Dead Spot occupies about 3 1/2" of joystick bio-mechanical travel, with the handgrip elevated 12" above the gimbal pivot. Thanks for any help.

Arduino: 1.8.13 (Windows 10), TD: 1.53, Board: "Teensy 3.2 / 3.1, Hotas X, 96 MHz (overclock), US English"


C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\malon\Documents\Arduino\libraries -fqbn=teensy:avr:teensy31:usb=hotasx,speed=96,keys=en-us -ide-version=10813 -build-path C:\Users\malon\AppData\Local\Temp\arduino_build_960816 -warnings=none -build-cache C:\Users\malon\AppData\Local\Temp\arduino_cache_843455 -verbose C:\Users\malon\Documents\Arduino Code Downloads\HotasX Original\HotasX\HotasX.ino

C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\malon\Documents\Arduino\libraries -fqbn=teensy:avr:teensy31:usb=hotasx,speed=96,keys=en-us -ide-version=10813 -build-path C:\Users\malon\AppData\Local\Temp\arduino_build_960816 -warnings=none -build-cache C:\Users\malon\AppData\Local\Temp\arduino_cache_843455 -verbose C:\Users\malon\Documents\Arduino Code Downloads\HotasX Original\HotasX\HotasX.ino

Using board 'teensy31' from platform in folder: C:\Program Files (x86)\Arduino\hardware\teensy\avr

Using core 'teensy3' from platform in folder: C:\Program Files (x86)\Arduino\hardware\teensy\avr

Detecting libraries used...

"C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-g++" -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -fno-exceptions -felide-constructors -std=gnu++0x -fno-rtti -mthumb -mcpu=cortex-m4 -fsingle-precision-constant -D__MK20DX256__ -DTEENSYDUINO=127 -DARDUINO=10813 -DARDUINO_TEENSY31 -DF_CPU=96000000 -DUSB_HOTASX -DLAYOUT_US_ENGLISH "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\cores\\teensy3" "C:\\Users\\malon\\AppData\\Local\\Temp\\arduino_build_960816\\sketch\\HotasX.ino.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE

Generating function prototypes...

"C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-g++" -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -fno-exceptions -felide-constructors -std=gnu++0x -fno-rtti -mthumb -mcpu=cortex-m4 -fsingle-precision-constant -D__MK20DX256__ -DTEENSYDUINO=127 -DARDUINO=10813 -DARDUINO_TEENSY31 -DF_CPU=96000000 -DUSB_HOTASX -DLAYOUT_US_ENGLISH "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\cores\\teensy3" "C:\\Users\\malon\\AppData\\Local\\Temp\\arduino_build_960816\\sketch\\HotasX.ino.cpp" -o "C:\\Users\\malon\\AppData\\Local\\Temp\\arduino_build_960816\\preproc\\ctags_target_for_gcc_minus_e.cpp" -DARDUINO_LIB_DISCOVERY_PHASE

"C:\\Program Files (x86)\\Arduino\\tools-builder\\ctags\\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\\Users\\malon\\AppData\\Local\\Temp\\arduino_build_960816\\preproc\\ctags_target_for_gcc_minus_e.cpp"

Compiling sketch...

"C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/precompile_helper" "C:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr/cores/teensy3" "C:\\Users\\malon\\AppData\\Local\\Temp\\arduino_build_960816" "C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-g++" -x c++-header -Os -g -Wall -ffunction-sections -fdata-sections -nostdlib -MMD -fno-exceptions -felide-constructors -std=gnu++0x -fno-rtti -mthumb -mcpu=cortex-m4 -fsingle-precision-constant -D__MK20DX256__ -DTEENSYDUINO=127 -DARDUINO=10813 -DARDUINO_TEENSY31 -DF_CPU=96000000 -DUSB_HOTASX -DLAYOUT_US_ENGLISH "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr/cores/teensy3" "C:\\Users\\malon\\AppData\\Local\\Temp\\arduino_build_960816/pch/Arduino.h" -o "C:\\Users\\malon\\AppData\\Local\\Temp\\arduino_build_960816/pch/Arduino.h.gch"

In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/Printable.h:25:0,

from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/Print.h:39,

from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/Stream.h:24,

from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/HardwareSerial.h:252,

from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/WProgram.h:16,

from C:\Users\malon\AppData\Local\Temp\arduino_build_960816\pch\Arduino.h:6:

C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/new.h:41:6: warning: 'void operator delete(void*, size_t)' is a usual (non-placement) deallocation function in C++14 (or with -fsized-deallocation) [-Wc++14-compat]

void operator delete(void * ptr, size_t size);

^

C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/new.h:42:6: warning: 'void operator delete [](void*, size_t)' is a usual (non-placement) deallocation function in C++14 (or with -fsized-deallocation) [-Wc++14-compat]

void operator delete[](void * ptr, size_t size);

^

In file included from C:\Users\malon\AppData\Local\Temp\arduino_build_960816\pch\Arduino.h:6:0:

C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/WProgram.h:52:21: error: ambiguating new declaration of 'uint32_t random()'

uint32_t random(void);

^

In file included from c:\program files (x86)\arduino\hardware\tools\arm\arm-none-eabi\include\stdlib.h:11:0,

from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/WProgram.h:4,

from C:\Users\malon\AppData\Local\Temp\arduino_build_960816\pch\Arduino.h:6:

c:\program files (x86)\arduino\hardware\tools\arm\arm-none-eabi\include\stdlib.h:253:6: note: old declaration 'long int random()'

long _EXFUN(random,(_VOID));

^

"C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-g++" -c -Os -g -Wall -ffunction-sections -fdata-sections -nostdlib -MMD -fno-exceptions -felide-constructors -std=gnu++0x -fno-rtti -mthumb -mcpu=cortex-m4 -fsingle-precision-constant -D__MK20DX256__ -DTEENSYDUINO=127 -DARDUINO=10813 -DARDUINO_TEENSY31 -DF_CPU=96000000 -DUSB_HOTASX -DLAYOUT_US_ENGLISH "-IC:\\Users\\malon\\AppData\\Local\\Temp\\arduino_build_960816/pch" "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\cores\\teensy3" "C:\\Users\\malon\\AppData\\Local\\Temp\\arduino_build_960816\\sketch\\HotasX.ino.cpp" -o "C:\\Users\\malon\\AppData\\Local\\Temp\\arduino_build_960816\\sketch\\HotasX.ino.cpp.o"

In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/Printable.h:25:0,

from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/Print.h:39,

from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/Stream.h:24,

from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/HardwareSerial.h:252,

from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/WProgram.h:16,

from C:\Users\malon\AppData\Local\Temp\arduino_build_960816/pch/Arduino.h:6,

from C:\Users\malon\AppData\Local\Temp\arduino_build_960816\sketch\HotasX.ino.cpp:1:

C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/new.h:41:6: warning: 'void operator delete(void*, size_t)' is a usual (non-placement) deallocation function in C++14 (or with -fsized-deallocation) [-Wc++14-compat]

void operator delete(void * ptr, size_t size);

^

C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/new.h:42:6: warning: 'void operator delete [](void*, size_t)' is a usual (non-placement) deallocation function in C++14 (or with -fsized-deallocation) [-Wc++14-compat]

void operator delete[](void * ptr, size_t size);

^

In file included from C:\Users\malon\AppData\Local\Temp\arduino_build_960816/pch/Arduino.h:6:0,

from C:\Users\malon\AppData\Local\Temp\arduino_build_960816\sketch\HotasX.ino.cpp:1:

C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/WProgram.h:52:21: error: ambiguating new declaration of 'uint32_t random()'

uint32_t random(void);

^

In file included from c:\program files (x86)\arduino\hardware\tools\arm\arm-none-eabi\include\stdlib.h:11:0,

from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/WProgram.h:4,

from C:\Users\malon\AppData\Local\Temp\arduino_build_960816/pch/Arduino.h:6,

from C:\Users\malon\AppData\Local\Temp\arduino_build_960816\sketch\HotasX.ino.cpp:1:

c:\program files (x86)\arduino\hardware\tools\arm\arm-none-eabi\include\stdlib.h:253:6: note: old declaration 'long int random()'

long _EXFUN(random,(_VOID));

^

Error compiling for board Teensy 3.2 / 3.1.
 
Pleased to say this mod still works, pr0ps to @DogP and @PaulStoffregen for the original work :D

I rewrote the main controller for a bit of learning and to add some features (deadzones, different filter types, led handling). The new files + updated instructions available here...

https://github.com/SpoddyCoder/teensy-hotas

Rather than try to modify the original 2016 files with the hacks in the remainder of the thread, I took latest teensy3.1 board files and re-applied the Hotas X interface... diff between the default and modified board files available here...

https://github.com/SpoddyCoder/teensy-hotas/commit/bcc00d9c30cdf59a3ea81ee41fbe30af6508d4a3
 
Back
Top