Tuan Nguyen 1 год назад
Родитель
Сommit
6c4e653017
2 измененных файлов с 24 добавлено и 0 удалено
  1. 12 0
      arduino_code/arduino_code.ino
  2. 12 0
      arduino_code_TMC2209/arduino_code_TMC2209.ino

+ 12 - 0
arduino_code/arduino_code.ino

@@ -186,6 +186,18 @@ void appMode()
             Serial.println(input);
             return;
         }
+        if (input == "RESET_THETA")
+        {
+            resetTheta(); // Reset currentTheta
+            Serial.println("THETA_RESET"); // Notify Python
+            Serial.println("READY");
+            return;
+        }
+        if (input == "HOME")
+        {
+            homing();
+            return;
+        }
 
         // Example: The user calls "SET_SPEED 60" => 60% of maxSpeed
         if (input.startsWith("SET_SPEED"))

+ 12 - 0
arduino_code_TMC2209/arduino_code_TMC2209.ino

@@ -187,6 +187,18 @@ void appMode()
             Serial.println(input);
             return;
         }
+        if (input == "RESET_THETA")
+        {
+            resetTheta(); // Reset currentTheta
+            Serial.println("THETA_RESET"); // Notify Python
+            Serial.println("READY");
+            return;
+        }
+        if (input == "HOME")
+        {
+            homing();
+            return;
+        }
 
 
         if (input.startsWith("SET_SPEED"))