#Transform/Map option (newbie).

1 messages · Page 1 of 1 (latest)

tacit mantle
#

Hi everyone! I'm new to MobiFlight and Arduino, but I know something to code with engines for drones and boats that I help to build in the University. I really don't know some deep codes to use in MF and all that things that It do, but I really want to learn and help other guys in the University to learn what we can do.

My issue here is by tranforming the atual joystick range to the 0-1023 range on the MobiFlight, but the model that I'm using isn't capable to tranform this values and I'm preparing some mods like gears, pulleys and belts to do the travel of the Joystick compatible with the potenciometer travel too.

What I have today is:
...ExecutionManager.mobiFlightCache_OnButtonPressed(): MobiFlight Mega => Profundor => CHANGE => 633...
when I'ts on one side of the range
...ExecutionManager.mobiFlightCache_OnButtonPressed(): MobiFlight Mega => Profundor => CHANGE => 347...
and this whe It's on another side of the range
And the formula that i'm using is:
@ 32.0293 * 16383 - -16383 max 16383 min (>K:AXIS_ELEVATOR_SET)
If I change the reading range like min and max, it makes a bug and keeps the rudder on the sim is the down or up side only. (After wrinting this, I were thiking that using one side of the potenciometer like (-16383/0 to -16097/286) or like) and set the readings to -16383 max and -16097 min could work better).
but, what I do in arduino sketchs is like (not exactly like this) map (profundor) (347, 633, 0, 1023) or something like this.
What I want to know is if this is possible and if you guys can help me to code this.

I really appreciate this space that you guys openned. Make good flights!

Nidsley Albino
Flight lover!

lone tusk