mirror of
https://github.com/thooge/esp32-nmea2000-obp60.git
synced 2025-12-16 07:23:07 +01:00
Rudder position page not finished
This commit is contained in:
@@ -356,6 +356,8 @@ void registerAllPages(PageList &list){
|
||||
list.add(®isterPageWhite);
|
||||
extern PageDescription registerPageBME280;
|
||||
list.add(®isterPageBME280);
|
||||
extern PageDescription registerPageRudderPosition;
|
||||
list.add(®isterPageRudderPosition);
|
||||
}
|
||||
|
||||
// OBP60 Task
|
||||
@@ -533,13 +535,14 @@ void OBP60Task(GwApi *api){
|
||||
}
|
||||
}
|
||||
|
||||
// If GPS fix then LED on (HDOP)
|
||||
// If GPS fix then LED off (HDOP)
|
||||
if(String(gpsFix) == "GPS Fix" && hdop->valid == true && int(hdop->value) <= 50){
|
||||
setPortPin(OBP_FLASH_LED, true);
|
||||
}
|
||||
if(String(gpsFix) == "GPS Fix" && ((hdop->valid == true && int(hdop->value) > 50) || hdop->valid == false)){
|
||||
setPortPin(OBP_FLASH_LED, false);
|
||||
}
|
||||
// Ifmissing GPS fix then LED on
|
||||
if(String(gpsFix) == "GPS Fix" && ((hdop->valid == true && int(hdop->value) > 50) || hdop->valid == false)){
|
||||
setPortPin(OBP_FLASH_LED, true);
|
||||
}
|
||||
|
||||
// Check the keyboard message
|
||||
int keyboardMessage=0;
|
||||
@@ -623,9 +626,11 @@ void OBP60Task(GwApi *api){
|
||||
starttime5 = millis();
|
||||
batteryVoltage = (float(analogRead(OBP_ANALOG0)) * 3.3 / 4096 + 0.17) * 20; // Vin = 1/20
|
||||
commonData.data.batteryVoltage = batteryVoltage; // Data take over to page
|
||||
// Send to NMEA200 bus
|
||||
SetN2kDCBatStatus(N2kMsg, 0, batteryVoltage, N2kDoubleNA, N2kDoubleNA, 1);
|
||||
api->sendN2kMessage(N2kMsg);
|
||||
// Send to NMEA200 bus
|
||||
if(!isnan(batteryVoltage)){
|
||||
SetN2kDCBatStatus(N2kMsg, 0, batteryVoltage, N2kDoubleNA, N2kDoubleNA, 1);
|
||||
api->sendN2kMessage(N2kMsg);
|
||||
}
|
||||
}
|
||||
|
||||
// Send data from environment sensor
|
||||
|
||||
Reference in New Issue
Block a user