diff options
| author | Nikita Kostovsky <nikita@kostovsky.me> | 2026-02-26 16:15:38 +0100 |
|---|---|---|
| committer | Nikita Kostovsky <nikita@kostovsky.me> | 2026-02-26 16:15:38 +0100 |
| commit | 8ec490b730ab061bf55c29a7b2253f56903eca59 (patch) | |
| tree | e79f75dbf85283ccc44bd10660ef52348b696fbc | |
| parent | d601b50fd078c0da5dcd1599c3cd3d40aad55df8 (diff) | |
| -rw-r--r-- | esp32c3_stand_firmware/esp32c3_stand_firmware.ino | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/esp32c3_stand_firmware/esp32c3_stand_firmware.ino b/esp32c3_stand_firmware/esp32c3_stand_firmware.ino index d2cb559..70debb7 100644 --- a/esp32c3_stand_firmware/esp32c3_stand_firmware.ino +++ b/esp32c3_stand_firmware/esp32c3_stand_firmware.ino @@ -128,8 +128,7 @@ void handleMove() const auto stepsStr = server.arg(stepsArg); s.print("handleMove: arg(stepsArg): "); s.println(stepsStr); - - server.send(200, "text/plain", "move " + stepsStr + " steps\n"); + stepperRun = true; stepper.enableOutputs(); @@ -138,6 +137,13 @@ void handleMove() //bool backward = rand() % 2; //stepper.move(8000 * (backward ? -1 : 1)); stepper.move(steps); + + while (stepper.distanceToGo() != 0) + { + stepper.run(); + } + + server.send(200, "text/plain", "move " + stepsStr + " steps\n"); } void handleStop() |
