// ============================================================ // INTERMISSION OBJECT — SHUTDOWN // Turns off all outputs immediately and holds them off. // OTA stays active so the next sketch can be uploaded wirelessly. // ============================================================ #include #include "DFRobot_TM6605.h" #include "wifi_ota.h" #define PIN_I2C_SDA 5 #define PIN_I2C_SCL 6 #define PIN_LED_PWM 4 #define PIN_MOTOR_PWM 7 #define PWM_FREQ_MOTOR 20000 #define PWM_FREQ_LED 24989 #define PWM_RES 8 void setup() { Serial.begin(115200); delay(500); Serial.println("\n=== INTERMISSION OBJECT — SHUTDOWN ==="); // Motor and LED off ledcAttach(PIN_MOTOR_PWM, PWM_FREQ_MOTOR, PWM_RES); ledcAttach(PIN_LED_PWM, PWM_FREQ_LED, PWM_RES); ledcWrite(PIN_MOTOR_PWM, 0); ledcWrite(PIN_LED_PWM, 0); // Haptic off Wire.begin(PIN_I2C_SDA, PIN_I2C_SCL); Wire.setClock(50000); delay(200); DFRobot_TM6605 TM6605; if (TM6605.begin() == 0) TM6605.stop(); setupWiFiOTA(); Serial.println("All outputs off. Ready for next OTA upload.\n"); } void loop() { handleOTA(); }