I’m finding the Pro Micro 5V is very cool and capable, but there is so much I don’t know about programming. I haven’t let that stop me from trying new things with it, however. I am running linux on a chromebook and have a flight sim called crrcsim that works great uisng mouse and keyboard, but I want to connect as a joystick or anything that crrcsim and linux will recognize. To start I found an Arduino project that will read PPM and connect as a joystick. It works great in windows and I can control an RC plane with it.
The problem is I want to connect to crrcsim on linux. When I plug the Pro Micro into the chromebook USB, it is seen as an ordinary serial device, /dev/ttyACM0. I believe if linux sees a joystick it needs to show up as /dev/input/js0. On windows the joystick is recognized as Arduino Leonardo, but no luck on linux.
I looked at the SparkFun example that converts a simple joystick into mouse movement, so I’m thinking instead of reading input from a joystick, I could use the PPM and convert that to mouse. Is this too kooky?
The other idea I have is to somehow output from the Pro Micro over an audio cable, but I don’t know which pins to use or how to write to them instead of over serial.write. I consider this because the crrcsim has an input option of “audio” and when I pull that down in menu, it sees my sound card device.
Here’s the link to the code I’m using on the Pro Micro:
https://wireless-rc-adapter.github.io/
There’s a library for Arduino that you might check out in the link below. I think that might work for you.
https://github.com/MHeironimus/ArduinoJoystickLibrary
As far as connecting via an audio port, I don’t think that’s going to work since Arduino’s output digital data rather than analog data.
The code I’m using already uses that library. It works fine for windows and is recognized as a joystick. Linux doesn’t see it that way. Not sure why. I tried a few different options in the code that had no noticeable effect in windows or linux except if I change the code into debug mode, then linux will see the output over serial as /dev/ttyACM0 in serial monitor.
One idea I have is to hook up my 3DR radio and transmit the output. The 3DR uses a different chip to connect serial. Maybe that will work.
The little test with the 3DR radio shows me that the crrcsim will see /dev/ttyUSB0 but not /dev/ttyACM0 . I read some developer notes from crrcsim and it says the audio type connection takes a PPM signal(which would be square waves from a tx or rx)and sends them over an audio cable to a sound card. I might still try that since the sparkfun hookup guide says that PWM can be output on some pins.
I got it working. I edited the crrcsim.xml file and told it directly which port and baud to use. I also went back to the first program I tried which uses FMSPIC protocol and only needs a couple hundred lines and one tab - no extra libraries and easy to understand. I didn’t get it to work the first time because I attached the signal from the rx to the wrong pin, duh.
Here’s the link to the code I’m using that works to connect the PPM output of my rx to the crrcsim on linux in a chromebook container.
https://www.min.at/prinz/fp-content/att … ic_int.ino
For what it’s worth I am playing with this again. I broke the USB connector on the first one and then I wanted to fly the simulator again, so I bought 4 of those promicro boards. It was a real test of my memory after 2 years which program to load but I remembered I posted the code here. Then I had to screw with crrcsim to get it to recognize the input method and now I’m flying again on the sim.