浏览代码

quick fix

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