add oled 12864
This commit is contained in:
1 parent
d163397de4
commit
4c68deb6bb
6 files changed
+327
-2
No files matched your search
@@ -35,6 +35,10 @@ HardwareSerial &RadarSerial = Serial2;
|
||||
LD2453Parser radar;
|
||||
ZoneManager zoneManager;
|
||||
|
||||
#if OLED_ENABLED
|
||||
OLEDDisplay oledDisplay(OLED_SDA_PIN, OLED_SCL_PIN, OLED_I2C_ADDR);
|
||||
#endif
|
||||
|
||||
#if !DIAGNOSTIC_MODE
|
||||
WebServerManager webServer(zoneManager);
|
||||
#endif
|
||||
@@ -104,8 +108,22 @@ void loop() {
|
||||
|
||||
#if DIAGNOSTIC_MODE
|
||||
printDiagnostics(frame, radar.getStats());
|
||||
|
||||
#if OLED_ENABLED
|
||||
oledDisplay.updateRadarInfo(frame, radar.getStats());
|
||||
#endif
|
||||
#else
|
||||
webServer.broadcastFrame(frame);
|
||||
|
||||
#if OLED_ENABLED
|
||||
// Hiển thị tóm tắt detection và zones
|
||||
oledDisplay.updateDetectionSummary(
|
||||
frame.targetCount,
|
||||
zoneManager.isZoneOccupied(0),
|
||||
zoneManager.isZoneOccupied(1),
|
||||
zoneManager.isZoneOccupied(2)
|
||||
);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -125,6 +143,11 @@ void loop() {
|
||||
Serial.print(F("Packets/sec: "));
|
||||
Serial.println(stats.packetsPerSecond, 1);
|
||||
lastStatsReport = now;
|
||||
|
||||
#if OLED_ENABLED
|
||||
// Cập nhật OLED ngay cả khi không có frame
|
||||
oledDisplay.updateStats(stats);
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
webServer.loop();
|
||||
|
||||
Reference in new issue
Block a user