1
0
mirror of https://github.com/thooge/esp32-nmea2000-obp60.git synced 2025-12-15 06:53:07 +01:00

Add BMP280 Sensor and deprecated PGN 130311 for Raymarine

This commit is contained in:
free-x
2024-06-02 14:31:16 +02:00
parent 0bb6898d6e
commit dd13dd0418
9 changed files with 447 additions and 6 deletions

View File

@@ -68,16 +68,20 @@ class BME280Config : public IICSensorBase{
if (!device)
return;
GwLog *logger = api->getLogger();
float pressure = N2kDoubleNA;
float temperature = N2kDoubleNA;
float humidity = N2kDoubleNA;
float computed = N2kDoubleNA;
if (prAct)
{
float pressure = device->readPressure();
float computed = pressure + prOff;
pressure = device->readPressure();
computed = pressure + prOff;
LOG_DEBUG(GwLog::DEBUG, "%s measure %2.0fPa, computed %2.0fPa", prefix.c_str(), pressure, computed);
sendN2kPressure(api, *this, computed, counterId);
}
if (tmAct)
{
float temperature = device->readTemperature(); // offset is handled internally
temperature = device->readTemperature(); // offset is handled internally
temperature = CToKelvin(temperature);
LOG_DEBUG(GwLog::DEBUG, "%s measure temp=%2.1f", prefix.c_str(), temperature);
sendN2kTemperature(api, *this, temperature, counterId);
@@ -88,6 +92,10 @@ class BME280Config : public IICSensorBase{
LOG_DEBUG(GwLog::DEBUG, "%s read humid=%02.0f", prefix.c_str(), humidity);
sendN2kHumidity(api, *this, humidity, counterId);
}
if (tmAct || prAct || (huAct && sensorId == 0x60))
{
sendN2kEnvironmentalParameters(api, *this, temperature, humidity, computed,counterId);
}
}
#define CFG280(prefix) \
CFG_GET(prAct,prefix); \