From ec3e3d0ba3be6718e6a3861ca6fc1b29dcff88ed Mon Sep 17 00:00:00 2001 From: Bernd Reuther Date: Thu, 4 Mar 2021 14:43:53 +0100 Subject: [PATCH] motor test --- kamera_server.py | 2 +- src/schrittmotor.py | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/kamera_server.py b/kamera_server.py index 9694e5b..da248bc 100644 --- a/kamera_server.py +++ b/kamera_server.py @@ -14,7 +14,7 @@ for pin in pins_out: for pin in pins_in: GPIO.setup(pins_in[pin]['nr'], GPIO.IN) -GPIO.output(pins_out['kamera']['nr'], GPIO.HIGH) +GPIO.output(pins_out['kamera']['nr'], GPIO.LOW) GPIO.setup(20, GPIO.OUT) m3_pwm4 = GPIO.PWM(20, freq) diff --git a/src/schrittmotor.py b/src/schrittmotor.py index 1b623e2..356e4c4 100644 --- a/src/schrittmotor.py +++ b/src/schrittmotor.py @@ -52,6 +52,12 @@ class motor(): self.pwm4 = GPIO.PWM(self.sp4, self.freq) self.pwm4.start(0) + def stop(self): + self.pwm1.stop() + self.pwm2.stop() + self.pwm3.stop() + self.pwm4.stop() + def vorwaerts(self, schritte): ges_schritte = schritte * 8 #print(str(ges_schritte))