Hi, I am trying to get joystick.h code working for a diy peddal project in the flight sim DCS. The serial monitor tells me I have values from 0-1023 and I have mapped these to 0 - 255. In the sim I move the potentiometer from right to left and get an decreasing value of left rudder. But going all the way to the right only makes the left rudder center and no more input can be made for the right rudder (f/a-18).
Can I remap the values to (0, 1023, -127, 127) and get equal input to the left and right rudders? I ask because I have read many code examples with the rudder being mapped to 0 -255.
Hi, sorry for all the confusion, I thought maybe this was a very simple issue for newbies like me that just started learning to code. I dont have the code right now, will post it later today. Im using the example sketch for a joystick library (2.0), adjusting it to only take a single input ie rudder. The example didnt have a rudder but throttle code was present and is what I based my code on . A throttle normaly goes from zero to greater than zero so the behavior I described for my rudder is expected now that I think about it.
The goal of the project is:
using a single analogue potentiometer (dont know if there are digital ones) to create pedal (rudder) input that DCS World can handle. Therefore, PWM didnt seem right from what I understand.
Ok, I adjusted the mapping to (0, 1023, -X, +X) and can read the expected values in the arduino serial monitor. I tried several different X values with expected results. Have not tried in game though, no time.
Many thanks to all your great comments. My issue is not new, I’ve read several posts with similar issues but it really helped to get direct feedback from the community. Take care all!