1 // OpenXsensor https://github.com/openXsensor/
2 // started by Rainer Schloßhan
4 //*******************************************************************************************************************************************************//
6 // ! IMPORTANT NOTE !!!!!!!!!! Another file in this project (see oXs_config_description.h) provides detailed explanations on how to set up this file. //
8 //*******************************************************************************************************************************************************//
9 // Note: the oXs_config.h file present on the GitHub site is not always meaningful.
10 // It could be that the combination of active/non active parameters is not consistent.
11 // This is just the result of many updates and tests in this document.
12 // So take always care to set up the oXs_config.h file according to your needs and check carefully all options.
13 // You can also use the oXs configurator in order to generate automatically a valid file.
20 // --------- 1 - General protocol ---------
21 // ***** 1.1 - Multiplex protocol is used (otherwise oXs assumes it is Frsky protocol) *****
23 // ***** 1.2 - FrSky protocol and device ID (required when Sport protocol is used) *****
24 //#define FRSKY_TYPE_SPORT // when uncommented, it forces oXs to apply only SPORT protocol, otherwise, oXs detects automatically if protocol has to be SPORT or HUB
25 //#define FRSKY_TYPE_HUB // when uncommented, it forces oXs to apply only HUB protocol, otherwise, oXs detects automatically if protocol has to be SPORT or HUB
26 #define SENSOR_ID 0x1B //0x1B
28 // --------- 2 - Serial data pin choice ---------
29 #define PIN_SERIALTX 4 // The pin which transmits the serial data to the FrSky telemetry receiver
31 // --------- 3 - PPM settings ---------
32 //#define PIN_PPM 3 // default is 2 but my own device use 3
33 #define PPM_MIN_100 980 // default 1500 - 512 ; // pulse width (usec) when TX sends a channel = -100
34 #define PPM_PLUS_100 1990 // default 1500 + 512 ; // pulse width (usec) when TX sends a channel = +100
36 // --------- 4 - Vario settings ---------
38 // ***** 4.1 - Connecting 1 or 2 MS5611 barometric sensor *****
39 #define VARIO // set as comment if there is no vario
40 //#define SENSOR_IS_BMP180 // set as comment if baro sensor is MS5611
41 //#define VARIO2 // set as comment if there is no second vario
43 // ***** 4.2 - Sensitivity predefined by program *****
44 #define SENSITIVITY_MIN 50
45 #define SENSITIVITY_MAX 300
46 #define SENSITIVITY_MIN_AT 100
47 #define SENSITIVITY_MAX_AT 1000
49 // ***** 4.3 - Sensitivity adjusted from the TX *****
50 #define SENSITIVITY_MIN_AT_PPM 10 // sensitivity will be changed by OXS only when PPM signal is between the specified range enlarged by -5 / +5
51 #define SENSITIVITY_MAX_AT_PPM 40
52 #define SENSITIVITY_PPM_MIN 20 // common value for vario is 20
53 #define SENSITIVITY_PPM_MAX 100 // common value for vario is 100
55 // ***** 4.4 - Hysteresis parameter & Alt compensation based on sensor temp *****
56 #define VARIOHYSTERESIS 5
57 //#define ALT_TEMP_COMPENSATION 800
59 // ***** 4.5 - Vertical speeds calculations *****
60 #define VARIO_PRIMARY 0 // 0 means first ms5611, 1 means second ms5611 , 2 means vario based on vario 1 + compensation from airspeed , 3 means average of first and second ms5611
61 //#define VARIO_SECONDARY 2 // 0 means first ms5611, 1 means second ms5611 , 2 means vario based on vario 1 + compensation from airspeed , 3 means average of first and second ms5611
62 //#define SWITCH_VARIO_MIN_AT_PPM 10
63 //#define SWITCH_VARIO_MAX_AT_PPM 90
65 // ***** 4.6 - Analog vertical speed *****
66 //#define PIN_ANALOG_VSPEED 3
67 #define ANALOG_VSPEED_MIN -3
68 #define ANALOG_VSPEED_MAX 3
70 // --------- 5 - Airspeed settings ---------
71 //#define AIRSPEED MS4525
73 #define AIRSPEED_RESET_AT_PPM 100
75 #define COMPENSATION_MIN_AT_PPM 60
76 #define COMPENSATION_MAX_AT_PPM 90
77 #define COMPENSATION_PPM_MIN 80
78 #define COMPENSATION_PPM_MAX 140
80 // --------- 6 - Voltages & Current sensor settings ---------
82 // ***** 6.1 - Voltage Reference to measure voltages and current *****
83 //#define USE_INTERNAL_REFERENCE // uncomment this line if you use 1.1 volt internal reference instead of Vcc
84 #define REFERENCE_VOLTAGE 4970 // set value in milliVolt; if commented, oXs will use or 1100 (if internal ref is used) or 5000 (othewise)
86 // ***** 6.2 - Voltage parameters *****
87 #define PIN_VOLTAGE 8 , 8 , 8 , 3 , 8 , 8 // set this line as comment if no one voltage have to be measured, set a value to 8 for the voltage(s) not to be measured.
88 #define RESISTOR_TO_GROUND 12 , 20 , 30 , 19.8 , 50 , 60 // set value to 0 when no divider is used for a voltage, can contains decimals
89 #define RESISTOR_TO_VOLTAGE 50 , 100.1 , 200 , 39 , 500 , 600 // set value to 0 when no divider is used for a voltage, can contains decimals
90 #define OFFSET_VOLTAGE -1 , 0 , 0 , 0 , 0 , 0 // optionnal, can be negative, must be integer
91 #define SCALE_VOLTAGE 1.1 , 1 , 1 , 1.004, 1 , 1 // optionnal, can be negative, can have decimals
93 // ***** 6.3 - Max number of Lipo cells to measure (and transmit to Tx) *****
94 #define NUMBEROFCELLS 1 // keep this line but set value to 0 (zero) if you do not want to transmit cell voltage.
96 // ***** 6.4 - Current parameters *****
97 //#define PIN_CURRENTSENSOR 3
98 #define MVOLT_AT_ZERO_AMP 2500 // in millivolt
99 #define MVOLT_PER_AMP 60 // in milliVolt per Amp
100 #define RESISTOR_TO_GROUND_FOR_CURRENT 19.8 // put as comment or set to 0 if no divider is used
101 #define RESISTOR_TO_CURRENT_SENSOR 39 // put as comment or set to 0 if no divider is used
103 // --------- 7 - RPM (rotations per minute) settings ---------
104 //#define MEASURE_RPM
106 // --------- 8 - Persistent memory settings ---------
107 //#define SAVE_TO_EEPROM
108 //#define PIN_PUSHBUTTON 2 // default is 10 but my own device is 2
110 // --------- 9 - Data to transmit ---------
111 // ***** 9.1 - Frsky data *****
112 #define SETUP_FRSKY_DATA_TO_SEND \
113 DEFAULTFIELD , ALTIMETER , 1 , 1 , 0 ,\
114 DEFAULTFIELD , VERTICAL_SPEED , 1 , 1 , 0 ,\
115 Vfas , VOLT4 , 1 , 1 ,0
116 // T2 , TEST3 , 1 , 1, 0
118 VSpd , PPM_VSPEED , 1 , 1 ,0 , \
119 DEFAULTFIELD , AIR_SPEED , 1 , 1 ,0 , \
120 AccX , VERTICAL_SPEED , 1 , 1 ,0 , \
121 AccZ , PRANDTL_DTE , 1 , 1 ,0 ,\
122 T1 , VOLT1 , 1 , 1 ,0 , \
123 T2 , VOLT2 , 1, 1, 0 , \
124 DEFAULTFIELD , CURRENTMA , 1, 1, 0 , \
125 DEFAULTFIELD , MILLIAH, 1, 1, 0 , \
126 Fuel , SENSITIVITY , 1, 1, 0
128 // ***** 9.2 - Multiplex data *****
129 #define SETUP_MULTIPLEX_DATA_TO_SEND \
130 3 , ALTIMETER , 1 , 1 , 0 , -16384 , 16383 , \
131 6 , VERTICAL_SPEED , 1 , 1 , 0, -500 , 500 , \
132 5 , REL_ALTIMETER , 1 , 1 , 0 , -16384 , 16383 , \
133 7 , CELL_TOT , 1 , 1 , 0 , -16384 , 16383 , \
134 5 , ALTIMETER_MAX , 1 , 1 , 0 , -16384 , 16383 , \
135 4 , VOLT4 , 1 , 1 , 0 , -16384 , 16383
136 // --------- 10 - Sequencer ---------
137 //#define SEQUENCE_OUTPUTS 0b100000
138 #define SEQUENCE_UNIT 100
139 #define SEQUENCE_m100 1 , 0b100000 , 1 , 0b000000 , 1 , 0b100000 , 1 , 0b000000
140 #define SEQUENCE_m75 1 , 0b100000 , 1 , 0b000000 , 2 , 0b100000 , 2 , 0b000000
141 #define SEQUENCE_m50 5 , 0b100000 , 5 , 0b000000
142 #define SEQUENCE_m25 5 , 0b100000 , 5 , 0b000000 , 0 , 0b100000
143 #define SEQUENCE_0 3 , 0b100000 , 1 , 0b000000
144 #define SEQUENCE_25 2 , 0b100000 , 2 , 0b000000
145 #define SEQUENCE_50 5 , 0b100000 , 5 , 0b000000
146 #define SEQUENCE_75 7 , 0b100000 , 7 , 0b000000
147 #define SEQUENCE_100 8 , 0b100000 , 8 , 0b000000
148 #define SEQUENCE_LOW 10 , 0b100000 ,10 , 0b000000 // sequence for Low voltage
149 //#define SEQUENCE_MIN_VOLT_6 4000 // sequence_100 will be activated if voltage 6 is lower that the value.
150 #define SEQUENCE_MIN_CELL 3000 // sequence_100 will be activated if lowest cell is lower that the value.
151 // --------- 11 - Reserved for developer. DEBUG must be activated here when we want to debug one or several functions in some other files. ---------
155 #include "HardwareSerial.h"
158 #endif// End define OXS_CONFIG_h