Go Down

Topic: Arduino DUE as a HID Joystick and PPM Decoder (Read 876 times) previous topic - next topic

f_a_s

I wanted to use the same RC Transmitter for flying my helis and trainig with my sim (Heli-X). My Transmitter has a training Port on the back which outputs a 8 Channel PPM Signal.

To get the DUE act as a HID Joystick device (on the Native Port) I had to change the provided USB files. Replace the following two files to get a working Joystick. Keep a copy of the original files, you'll have to revert to them if you want to use your DUE as a Mouse or Keyboard HID Device again. I didn't get a multi HID device (Mouse, Joy and Keyboard) working maybe somone else knows how to ?

arduino-nightly/hardware/arduino/sam/cores/arduino/USB/HID.cpp
http://www.netzkonzept.ch/download/dueppmjoystick/HID.cpp

arduino-nightly/hardware/arduino/sam/cores/arduino/USB/USBAPI.h
http://www.netzkonzept.ch/download/dueppmjoystick/USBAPI.h

WARNING: CHECK OUTPUT VOLTAGE OF YOUR RC TRANSMITTER BEFORE INTERFACING WITH THE DUE. USE A VOLTAGE DIVIDER  TO REDUCE VOLTAGE TO 3.3V MAX. IF YOU INPUT MORE THAN 3.3V INTO YOUR DUE IT MIGHT BE DAMAGED SERIOUSLY !!

My Transmitter outputs the PPM Signal at 5V therefore I use a 10kOhm Potientiometer as voltage divider to reduce the voltage to ca. 3V.

To process the PPM Signal (at Pin 2) and map it to joystick movements I use the following sketch
http://www.netzkonzept.ch/download/dueppmjoystick/ArduinoDue_8CH_PPM_Joy.ino

Don't forget to connect the DUE via the Native USB Port after programming via programming Port.

Happy flight.

eklynx

Did you have to rebuild the entire Arduino IDE after your changes, or were your changes picked up when rebuilding/updating your sketchbook?

Go Up