Usb serial inputs #77
Replies: 4 comments 6 replies
-
i suppose i could output sbus from the pi, and use the sbus in when its available... as sbus is easier to generate cleanly on a pi than ppm i can send the pi side if you want (its not pretty though, its using pyusb to raw read the usb devices) |
Beta Was this translation helpful? Give feedback.
-
I think SBUS in when I get back to it would be a great & fast method. I had it all written too and deleted it when clicking the wrong button on GIT ;( Never finished it off. It could be very easily added to USB serial as well. It would have to be passed in JSON format e.g. |
Beta Was this translation helpful? Give feedback.
-
Hi @scott-adamson1975 i'm currently working on a similar setup, but you don't need an additionnal arduino. You can use this python lib: https://abyz.me.uk/rpi/pigpio to accurately generate the PPM. GPIO of the PI output 3.3V so it's safe to connect. Then in python i use the HID and multi threading to read devices connected. @dlktdr i've maybe a question about the latency of 2 sequential PPM, i don't know how it's implemented in this project. The PPM from the PI will be a 20ms frame, does the current implementation wait the whole PPM frame input or start to forward the wave, and just add at the end the CH7/CH8 of the head tracked to avoid 40ms latency ? |
Beta Was this translation helpful? Give feedback.
-
i went the other way round, i used the raspberry pi to read the joystick,
then sent the current values to the arduino via fast serial, the arduino is
able to generate the ppm perfectly, the pi as it is not a microcontroller
had a lot of jitter in the generated ppm signal
plus the pi was easier to read the joystick, lost my marbles trying to use
usb on arduino, didnt have the patience for raw reading the device
descriptor to figure out where the values were in the record
…On Wed, 23 Oct 2024 at 10:10, CAA90 ***@***.***> wrote:
Hello,
I am not an expert in this field, so please feel free to correct me if I
say something incorrect. I am very interested in this topic because I am
trying to do a similar project, connecting my Hotast X joystick as a
peripheral to have a more immersive flight.
For now I used an Arduino mega with a built-in USB port to which I
connected the joystick, debugged and wrote code to have four ppm channels
output from one pin, and added eight buttons (two for each channel +/- ) to
adjust the trim of the four channels. I tested the whole thing by
connecting the output signal to the trainer port of my RC remote control
and it works, but I found a lot of latency in the commands, probably due to
the fact that I am not a coding expert and better code should be made.
I'm asking for advice, on how to proceed: is it better not to use arduino
mega but raspberry to generate PPM signal? how do i connect ppm input to
the head tracker to output a signal including ch7 and 8 for FPV camera
movement? wouldn't it be better to connect the joystick potentiometers
instead of the gibals directly into the radio? Thanks
—
Reply to this email directly, view it on GitHub
<#77 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHZKUCOJTMJSLUYWMGMSUJLZ45KW5AVCNFSM6AAAAABK535YGKVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCMBSGYZDINA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
would it be possible to add input via usb serial?
i currently use a raspberry pi that accepts x amount of usb peripherals (joystick, hotas pedals) in a python script and outputs a simple serial signal in bytes to an arduino that encodes a ppm signal
min chan value 0 max 1000, 2 channels 1 @ 550 2 @ 200 for example
255, 2,50,1,0,254 (repeat)
any chance of you supporting something similar via the usb connector?
(or even better no idea if a host shield can attach to a ble 33....)
at the moment i have to go
accepting a serial signal into the ble would remove the nano and kill a possible point of failure, im new to the world of arduino so my embedded skills are a bit weak...
Beta Was this translation helpful? Give feedback.
All reactions