#if defined(T5X_CONDITIONAL_INITIALIZE_EEPROM) || not defined(T5X_USE_EEPROM)
const t5x::T5xDeviceProperties_t gDefaultDeviceSettings=
{
{ // Calibration ChannelReverse Comment
{{0 , 512, 1023}, false}, //A0 {MIN, MID, MAX}, ChannelReverse AIL
{{0 , 512, 1023}, false}, //A1 {MIN, MID, MAX}, ChannelReverse ELE
{{0 , 512, 1023}, false}, //A2 {MIN, MID, MAX}, ChannelReverse THR
{{0 , 512, 1023}, false}, //A3 {MIN, MID, MAX}, ChannelReverse RUD
{{0 , 512, 1023}, true}, //A4 {MIN, MID, MAX}, ChannelReverse reserved for I2C SDA, no need for calibration
{{0 , 512, 1023}, true}, //A5 {MIN, MID, MAX}, ChannelReverse reserved for I2C SCL, no need for calibration
{{0 , 512, 1023}, true}, //A6 {MIN, MID, MAX}, ChannelReverse Potentiometer
{{0 , 512, 1023}, true} //A7 {MIN, MID, MAX}, ChannelReverse voltage sensor, no need for calibration
},
{
{false}, // SW1 Reverse
{false}, // SW2 Reverse
{false}, // SW3 Reverse
},
{
[color=red]{ 4, 12, 11}, // TX Voltage Monitoring: CellCount, Orange, Red Level[/color]
{ 40, 30}, // RSSI Percentage: Orange, Red Level
10, // Telemetry Check Interval in seconds
},
20, // Flight Timer Throttle threshold percentage
{ -256, -110, -40, 40, 110, 256}, // VFM Steps
false,
false
};
#endif
if (g_OperatingMode==OperatingMode_Normal)
{
g_Frsky.update(); // read telemetry data from serial link and update the values
if ((now - last_telemetry >= gTxDevice.m_Properties.TelemetrySettings.Check_Interval*1000))
{
last_telemetry = now;
float voltageTX = analogRead(T5X_TX_VOLT_PIN)*0.0146627565982405; // 0-15V in 1023 steps or 0,0146V per step
if (voltageTX < gTxDevice.m_Properties.TelemetrySettings.V_TX[T5X_CELLCOUNT]*gTxDevice.m_Properties.TelemetrySettings.V_TX[T5X_RED]/10.0){
[color=blue]rc::g_Buzzer.beep(2,2,13);[/color]
Serial.print("Voltage Alarm RED");
Serial.println();
Serial.print("voltageTX IST = ");
Serial.print(voltageTX);
Serial.println();
Serial.print("voltageTX COMP = ");
Serial.print(gTxDevice.m_Properties.TelemetrySettings.V_TX[T5X_CELLCOUNT]*gTxDevice.m_Properties.TelemetrySettings.V_TX[T5X_RED]/10.0);
Serial.println();
Serial.println();
}
else if (voltageTX < gTxDevice.m_Properties.TelemetrySettings.V_TX[T5X_CELLCOUNT]*gTxDevice.m_Properties.TelemetrySettings.V_TX[T5X_ORANGE]/10.0){
[color=blue]rc::g_Buzzer.beep(2,2,6);[/color]
Serial.print("Voltage Alarm ORANGE");
Serial.println();
Serial.print("voltageTX IST = ");
Serial.print(voltageTX);
Serial.println();
Serial.print("voltageTX COMP = ");
Serial.print(gTxDevice.m_Properties.TelemetrySettings.V_TX[T5X_CELLCOUNT]*gTxDevice.m_Properties.TelemetrySettings.V_TX[T5X_RED]/10.0);
Serial.println();
Serial.println();
}
if (g_Frsky.TelemetryLinkAlive())
{
if (g_Frsky.m_A1_Voltage*0.0517647058823529 < gProfile.m_Data.V_A1[T5X_CELLCOUNT]*gProfile.m_Data.V_A1[T5X_RED]/10.0) rc::g_Buzzer.beep(10,10,2); // 0-13,2V in 255 steps or 0,052V per step
else if (g_Frsky.m_A1_Voltage*0.0517647058823529 < gProfile.m_Data.V_A1[T5X_CELLCOUNT]*gProfile.m_Data.V_A1[T5X_ORANGE]/10.0) rc::g_Buzzer.beep(20); // 0-13,2V in 255 steps or 0,052V per step
if (g_Frsky.m_A2_Voltage*0.0129411764706*((gProfile.m_Data.V_A2[T5X_CELLCOUNT] & 0xF0) >> 4) < (gProfile.m_Data.V_A2[T5X_CELLCOUNT] & 0x0F)*gProfile.m_Data.V_A2[T5X_RED]/10.0) rc::g_Buzzer.beep(10,10,2); // 0-3,3V in 255 steps or 0,013V per step, the real voltage range is actually defined by the voltage divider ratio
else if (g_Frsky.m_A2_Voltage*0.0129411764706*((gProfile.m_Data.V_A2[T5X_CELLCOUNT] & 0xF0) >> 4) < (gProfile.m_Data.V_A2[T5X_CELLCOUNT] & 0x0F)*gProfile.m_Data.V_A2[T5X_ORANGE]/10.0) rc::g_Buzzer.beep(20); // 0-3,3V in 255 steps or 0.013V per step, the real voltage range is actually defined by the voltage divider ratio
if (g_Frsky.m_RSSI < gTxDevice.m_Properties.TelemetrySettings.RSSIPercent[T5X_RED]*255/100) rc::g_Buzzer.beep(10,10,2);
else if (g_Frsky.m_RSSI < gTxDevice.m_Properties.TelemetrySettings.RSSIPercent[T5X_ORANGE]*255/100) rc::g_Buzzer.beep(20);
}
else{
[color=green]delay(1000);[/color]
[color=red]rc::g_Buzzer.beep(5,5,2);[/color]
}
}
}