initial commit [141.14.129.234,mike]

This commit is contained in:
mike committed 2026-10-13 19:55:01 +02:00
commit 80dedb840f
22 files changed
+1723

No files matched your search

+26
View File
@@ -0,0 +1,26 @@
// Gemeinsame Bausteine aller Apps: Schriften, Statuszeile mit App-Punkten und Akkuanzeige.
#pragma once
#include <Adafruit_GFX.h>
#include <U8g2_for_Adafruit_GFX.h>
const int STATUS_LINE_Y = 111; // Trennlinie über der Statuszeile (Querformat 296x128)
struct StatusInfo {
float batteryVoltage; // Volt, NAN ohne Messwert (dann ohne Akkuanzeige)
int appIndex;
int appCount;
};
extern const char* const DAY_NAMES[7]; // "So", "Mo", … "Sa"
// Wochentag, 0 = Sonntag; date im Format "YYYY-MM-DD"
int weekday(const char* date);
// setFont schaltet den transparenten Modus ab (der Hintergrund wäre dann schwarz), daher immer hierüber
void useFont(U8G2_FOR_ADAFRUIT_GFX& fonts, const uint8_t* font);
void drawCentered(U8G2_FOR_ADAFRUIT_GFX& fonts, const char* text, int centerX, int baseline);
int batteryPercent(float voltage);
// Statuszeile: links Text, in der Mitte ein Punkt pro App (aktuelle gefüllt), rechts der Akku
void drawStatusBar(Adafruit_GFX& gfx, U8G2_FOR_ADAFRUIT_GFX& fonts, const char* leftText, const StatusInfo& status);