Merge branch 'main' of tesserakt.pro:alex/arduino-filament-dryer
This commit is contained in:
34
src/main.cpp
34
src/main.cpp
@@ -125,9 +125,24 @@ void printStatus(float avgTemp, float minTemp, float maxTemp) {
|
||||
Serial.print(thermal.heaterAllowance(), 0);
|
||||
Serial.print(F("% heater="));
|
||||
Serial.print(thermal.heaterDutyPercent(), 1);
|
||||
Serial.print(F("% fan="));
|
||||
Serial.print(F("% htop="));
|
||||
if (thermal.isIdle()) {
|
||||
Serial.print(F("n/a"));
|
||||
} else {
|
||||
Serial.print(thermal.maxHeatStopAt(avgTemp), 1);
|
||||
}
|
||||
Serial.print(F("C hblk="));
|
||||
Serial.print(thermal.heaterBlockReason());
|
||||
Serial.print(F(" ssr="));
|
||||
Serial.print(thermal.isHeaterSsrOn() ? F("on") : F("off"));
|
||||
Serial.print(F(" fan="));
|
||||
Serial.print(thermal.fanPwm());
|
||||
Serial.print(F("/255("));
|
||||
Serial.print((thermal.fanPwm() * 100) / 255);
|
||||
if (thermal.isIdle() && thermal.isFanOff()) {
|
||||
Serial.print(F("%)"));
|
||||
if (thermal.isFanTestActive(millis())) {
|
||||
Serial.print(F(" TEST"));
|
||||
} else if (thermal.isIdle() && thermal.isFanOff()) {
|
||||
Serial.print(F("(off)"));
|
||||
} else if (thermal.isIdleCooling()) {
|
||||
Serial.print(F("(cooldown)"));
|
||||
@@ -181,6 +196,7 @@ void printHelp() {
|
||||
Serial.println(F(" target <C> set target (0 = idle)"));
|
||||
Serial.println(F(" fan off cancel idle fan override (auto-off below 40C)"));
|
||||
Serial.println(F(" fan on idle fan 30% (optional, auto-off below 40C)"));
|
||||
Serial.println(F(" fan test N set fan PWM 0-255 for 15s (verify wiring)"));
|
||||
Serial.println(F(" autotune [C] learn PID (default: 40C when idle)"));
|
||||
Serial.println(F(" autotune stop"));
|
||||
Serial.println(F(" pid show PID / adaptive status"));
|
||||
@@ -259,6 +275,20 @@ void processSerialLine(const char *line) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (strncmp(line, "fan test ", 9) == 0) {
|
||||
const int pwm = atoi(line + 9);
|
||||
if (pwm < 0 || pwm > 255) {
|
||||
Serial.println(F("ERR fan test PWM must be 0-255"));
|
||||
return;
|
||||
}
|
||||
thermal.stopFanTest();
|
||||
thermal.startFanTest(static_cast<uint8_t>(pwm), millis());
|
||||
Serial.print(F("OK fan PWM="));
|
||||
Serial.print(pwm);
|
||||
Serial.println(F(" for 15s — check speed/noise on D5"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (strcmp(line, "status") == 0) {
|
||||
const float avgTemp = averageValidTemperature();
|
||||
const float minTemp = minValidTemperature();
|
||||
|
||||
Reference in New Issue
Block a user