Greetings.
I am continuing with my home cockpit using X-Plane and have come to an abrupt stop in attempting to interface a flaps gauge.
On my flaps gauge indicator (of which, there are two on my instrument panel, 1 for outboard flaps, 1 for inboard flaps), there are 8 positions which represent the degrees of flap deployment during flight operations. These positions are represented as degrees….0, 2, 5, 15, 20, 25, 30 and 40. Internally, they are operated with synchro receivers which will be driven by a stand alone NEMA stepper motor and using the AccelStepper library function to include step and direction for the sake of simplicity (e.g., only 2 pins to/from the DRV8825 board and stepper). The steppers are meshed with external gears to a synchro transmitter to send signals to the gauge’s internal synchro receiver.
Each position has a data ref, which is a value assigned by X-Plane for each flap position. Thes values remain constant for each flap setting.
Given my limited knowledge of the MAP() function, I do not believe there is a way to accurately map values; The data refs values are as follows:
0 = 0
2 = 0.142857
5 = 0.285714
15 = 0.428571
20 = 0.571429
25 = 0.714286
30 = 0.857143
40 = 1
With the map() function, fractional values are truncated and are not rounded. I have considered defining each value as an integer but am not sure if this is a possibility.
I will post the sketch I’ve compiled when I’m at home and have access to the PC it is loaded on.
In the meantime, I would appreciate thoughts on this so I can proceed.
Thank you kindly in advance.
Jay