Tuan Nguyen 1 سال پیش
والد
کامیت
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"))