Skip to content

Commit

Permalink
Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
norbert-walter committed Apr 27, 2024
1 parent 2b885ec commit 6b60487
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/obp60task/OBPSensorTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ void sensorTask(void *param){
long starttime10 = millis(); // Generator power sensor update all 1s
long starttime11 = millis(); // Copy GPS data to RTC all 5min
long starttime12 = millis(); // Get RTC data all 500ms
long starttime13 = millis(); // Get 1Wire sensor data all 1s
long starttime13 = millis(); // Get 1Wire sensor data all 2s

tN2kMsg N2kMsg;
shared->setSensorData(sensors); //set initially read values
Expand Down Expand Up @@ -385,8 +385,8 @@ void sensorTask(void *param){
}
}

// Send 1Wire data for all temperature sensors all 1s
if(millis() > starttime13 + 1000 && String(oneWireOn) == "DS18B20" && oneWire_ready == true){
// Send 1Wire data for all temperature sensors all 2s
if(millis() > starttime13 + 2000 && String(oneWireOn) == "DS18B20" && oneWire_ready == true){
starttime13 = millis();
float tempC;
ds18b20.requestTemperatures(); // Collect all temperature values (max.8)
Expand All @@ -400,9 +400,9 @@ void sensorTask(void *param){
// Send to NMEA200 bus for each sensor with instance number
if(!isnan(tempC)){
sensors.onewireTemp[i] = tempC; // Save values in SensorData
api->getLogger()->logDebug(GwLog::DEBUG,"DS18B20-%1d Temp: %.1f",i,tempC);
SetN2kPGN130316(N2kMsg, 0, i, N2kts_OutsideTemperature, CToKelvin(tempC), N2kDoubleNA);
api->sendN2kMessage(N2kMsg);
api->getLogger()->logDebug(GwLog::LOG,"DS18B20-%1d Temp: %.1f",i,tempC);
}
}
}
Expand Down

0 comments on commit 6b60487

Please sign in to comment.