Tuan Nguyen 1 rok temu
rodzic
commit
6c4e653017

+ 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"))