updated models and code

This commit is contained in:
2026-04-26 10:09:22 +02:00
parent 0508e97d9e
commit 5e1f284c1c
12 changed files with 25971 additions and 10 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

1649
cad/sensor_box-Body.obj Normal file

File diff suppressed because it is too large Load Diff

Binary file not shown.

BIN
cad/sensor_box.FCStd Normal file

Binary file not shown.

View File

@@ -0,0 +1,12 @@
# Blender 5.1.0 MTL File: 'None'
# www.blender.org
newmtl SVGMat
Ns 360.000000
Ka 1.000000 1.000000 1.000000
Kd 0.000000 0.000000 0.000000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2

24273
cad/server-lid-Body.obj Normal file

File diff suppressed because it is too large Load Diff

Binary file not shown.

BIN
cad/server-lid.FCStd Normal file

Binary file not shown.

BIN
cad/server-with-logo.stl Normal file

Binary file not shown.

View File

@@ -129,18 +129,45 @@ void connectMQTT() {
}
void handle_oled(float tempC, float humidity) {
char line1[20], line2[20], line3[20];
snprintf(line1, sizeof(line1), "T: %.1f C", tempC);
snprintf(line2, sizeof(line2), "H: %.0f %%", humidity);
const char* lvl = fanLevel > 0 ? LEVELS[fanLevel - 1].label : "0";
snprintf(line3, sizeof(line3), "Fan: %s L%s",
fanLevel > 0 ? "ON" : "OFF", lvl);
(void)humidity;
char tempStr[12];
snprintf(tempStr, sizeof(tempStr), "%.1f", tempC);
u8g2.clearBuffer();
u8g2.setFont(u8g2_font_4x6_tr);
u8g2.drawStr(xOffset, yOffset, line1);
u8g2.drawStr(xOffset, yOffset + 10, line2);
u8g2.drawStr(xOffset, yOffset + 20, line3);
// Large temperature reading + small °C suffix, centered as a unit.
u8g2.setFont(u8g2_font_logisoso22_tn);
int tempW = u8g2.getStrWidth(tempStr);
const int suffixW = 10; // approx width reserved for "°C"
const int gap = 2;
int totalW = tempW + gap + suffixW;
int tempX = (128 - totalW) / 2;
int tempY = 46;
u8g2.drawStr(tempX, tempY, tempStr);
u8g2.setFont(u8g2_font_6x10_tr);
int suffixX = tempX + tempW + gap;
u8g2.drawStr(suffixX, tempY - 14, "o");
u8g2.drawStr(suffixX, tempY - 2, "C");
// Fan level indicator: 5 stacked bars at the bottom.
// Filled bars = current level, empty bars = remaining.
const int barCount = NUM_LEVELS;
const int barW = 18;
const int barH = 6;
const int barGap = 2;
const int barsW = barCount * barW + (barCount - 1) * barGap;
const int barY = 56;
int barX0 = (128 - barsW) / 2;
for (uint8_t i = 0; i < barCount; i++) {
int x = barX0 + i * (barW + barGap);
if (i < fanLevel) {
u8g2.drawBox(x, barY, barW, barH);
} else {
u8g2.drawFrame(x, barY, barW, barH);
}
}
u8g2.sendBuffer();
}