Explorar el Código

fix servo script

Silas Gruen hace 5 meses
padre
commit
9a9b8fe69f
Se han modificado 1 ficheros con 2 adiciones y 5 borrados
  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()