diff --git a/src/core/actuators/actuators.cpp b/src/core/actuators/actuators.cpp index 15774a6..e07c618 100644 --- a/src/core/actuators/actuators.cpp +++ b/src/core/actuators/actuators.cpp @@ -2,7 +2,7 @@ #include "config.h" #include "actuators.h" -void actuatorsInit() { +bool actuatorsInit() { pinMode(PIN_LB, OUTPUT); pinMode(PIN_LF, OUTPUT); pinMode(PIN_RB, OUTPUT); @@ -14,8 +14,15 @@ void actuatorsInit() { ledcAttachPin(L_PWM_PIN, PWM_CH_L); ledcAttachPin(R_PWM_PIN, PWM_CH_R); + Serial.println("Actuators initialized"); + Serial.printf(" L_PWM → GPIO%d\n", L_PWM_PIN); + Serial.printf(" R_PWM → GPIO%d\n", R_PWM_PIN); + Serial.printf(" L_DIR → GPIO%d, %d\n", PIN_LB, PIN_LF); + Serial.printf(" R_DIR → GPIO%d, %d\n", PIN_RB, PIN_RF); + actuatorsSetSpeed(150, 150); actuatorsStop(); + return true; } void actuatorsStop() { diff --git a/src/core/actuators/actuators.h b/src/core/actuators/actuators.h index 8d37c8c..58c2ba5 100644 --- a/src/core/actuators/actuators.h +++ b/src/core/actuators/actuators.h @@ -1,6 +1,6 @@ #pragma once -void actuatorsInit(); +bool actuatorsInit(); void actuatorsStop(); void actuatorsForward(); diff --git a/src/main.cpp b/src/main.cpp index d140d75..acc2e6d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -44,15 +44,19 @@ void runStartupChecks() { "", ""); delay(DELAY_FOR_STARTUP_CHECKS); - // TODO: Этап 4-5 (другие проверки) + // Этап 4: Проверка моторов (actuators) oledSetStage(4, TOTAL_STAGES); + bool actuatorsOk = actuatorsInit(); + oledShowMain(actuatorsOk ? "Motors: OK" : "Motors: FAIL", + "", "", ""); delay(DELAY_FOR_STARTUP_CHECKS); + // Этап 5: Проверка WiFi oledSetStage(5, TOTAL_STAGES); delay(DELAY_FOR_STARTUP_CHECKS); // Все проверки пройдены - oledSetSystemReady(joyOk && servoOk && ultrasonicOk); + oledSetSystemReady(joyOk && servoOk && ultrasonicOk && actuatorsOk); } void setup() { @@ -63,7 +67,6 @@ void setup() { // Запуск проверок runStartupChecks(); - actuatorsInit(); webServerInit(); wsInit();