feat: Zambretti forecast with trend classification
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include "display_ui.h"
|
||||
#include "sensors.h"
|
||||
#include "rtc_time.h"
|
||||
#include "forecast.h"
|
||||
|
||||
static void i2cScan() {
|
||||
Serial.println(F("I2C scan:"));
|
||||
@@ -34,6 +35,17 @@ void setup() {
|
||||
Serial.println(F("RTC lost power -> setting to build time"));
|
||||
rtcSet(RtcTime{2026, 7, 17, 12, 0, 0}); // temporary; NTP will correct later
|
||||
}
|
||||
|
||||
// --- forecast self-test (remove after Task 8) ---
|
||||
struct { float p; Trend tr; } cases[] = {
|
||||
{1030, TREND_STEADY}, {1030, TREND_RISING}, {1030, TREND_FALLING},
|
||||
{1000, TREND_STEADY}, {1000, TREND_FALLING}, {970, TREND_FALLING},
|
||||
};
|
||||
for (auto& c : cases) {
|
||||
Forecast f = computeForecast(c.p, c.tr, 7);
|
||||
Serial.printf("p=%.0f trend=%d -> %c [%s] (%s)\n",
|
||||
c.p, c.tr, f.letter, f.text, categoryShort(f.category));
|
||||
}
|
||||
}
|
||||
|
||||
void loop() {
|
||||
|
||||
Reference in New Issue
Block a user