Ver Fonte

fix servo script

Silas Gruen há 5 meses atrás
pai
commit
9a9b8fe69f
1 ficheiros alterados com 2 adições e 5 exclusões
  1. 2 5
      playgrounds/servo.py

+ 2 - 5
playgrounds/servo.py

@@ -15,7 +15,7 @@ def main():
             break
 
         if not pi.connected:
-            raise RuntimeError(f"Failed to connect to pigpio daemon for pin {pin}")
+            raise RuntimeError(f"Failed to connect to pigpio daemon for pin {servo_pin}")
         
         try:
             angle = float(cmd)
@@ -31,9 +31,6 @@ def main():
             
         except Exception as e:
             print(f"Invalid input: {e}")
-        finally:
-            pi.write(servo_pin, 0)
-            pi.stop()
-
+            
 if __name__ == "__main__":
     main()