feat: BMP180 read and sea-level pressure conversion

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-17 19:43:03 +07:00
co-authored by Claude Opus 4.8
parent 906adaddfe
commit d042a94378
3 changed files with 37 additions and 0 deletions
+8
View File
@@ -2,6 +2,7 @@
#include <Wire.h>
#include "config.h"
#include "display_ui.h"
#include "sensors.h"
static void i2cScan() {
Serial.println(F("I2C scan:"));
@@ -25,7 +26,14 @@ void setup() {
displayBegin();
displaySplash("Weather", "Predictor v0.1");
if (!sensorsBegin()) Serial.println(F("BMP180 not found!"));
}
void loop() {
float abs_ = readAbsPressureHpa();
float msl = toSeaLevelHpa(abs_, DEFAULT_ALTITUDE_M);
Serial.printf("abs=%.1f hPa msl=%.1f hPa t=%.1f C\n",
abs_, msl, readTemperatureC());
delay(2000);
}