From 0906d34cb6882894ab98807ca1456f67e55c80a2 Mon Sep 17 00:00:00 2001 From: Bernd Reuther Date: Fri, 5 Mar 2021 15:26:18 +0100 Subject: [PATCH] motor test --- kamera_server.py | 3 +++ src/einstellungen.py | 12 ++++++------ src/schrittmotor.py | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/kamera_server.py b/kamera_server.py index 4ef1391..c46747b 100644 --- a/kamera_server.py +++ b/kamera_server.py @@ -26,12 +26,15 @@ pi.write(pins_out['kamera']['nr'], 0) m1 = motor('drehen', m1_a1, m1_b1, m1_a2, m1_b2, m1_t1, m1_t2, m1_te, m1_es, 1, 180) m2 = motor('kippen', m2_a1, m2_b1, m2_a2, m2_b2, m2_t1, m2_t2, m2_te, m2_es, 1, 90) +m3 = motor('zoom', m3_a1, m3_b1, m3_a2, m3_b2, m3_t1, m3_t2, m3_te, m3_es, 0, 40) m1.start() m2.start() +m3.start() m1.eichen() m2.eichen() +m3.eichen() m1.vorwaerts(100) #m1.stop() diff --git a/src/einstellungen.py b/src/einstellungen.py index 58be946..4ce1e63 100644 --- a/src/einstellungen.py +++ b/src/einstellungen.py @@ -1,16 +1,16 @@ freq = 800 freq_halten = 30000 -cyc_halten = 20 +cyc_halten = 40 pins_out = { - 'kamera' : {'nr' : 2, 'name' : 'Relais, Kamera', 'state' : True}, - 'encoder' : {'nr' : 3, 'name' : 'Relais, Encoder', 'state' : True} + 'kamera' : {'nr' : 2, 'name' : 'Relais, Kamera', 'state' : 1}, + 'encoder' : {'nr' : 3, 'name' : 'Relais, Encoder', 'state' : 1} } pins_in = { - 'endschalter1' : {'nr' : 23, 'name' : 'Endschalter, Motor 1', 'state' : True}, - 'endschalter2' : {'nr' : 26, 'name' : 'Endschalter, Motor 2', 'state' : True}, - 'endschalter3' : {'nr' : 25, 'name' : 'Endschalter, Motor 3', 'state' : True} + 'endschalter1' : {'nr' : 23, 'name' : 'Endschalter, Motor 1', 'state' : 1}, + 'endschalter2' : {'nr' : 26, 'name' : 'Endschalter, Motor 2', 'state' : 1}, + 'endschalter3' : {'nr' : 25, 'name' : 'Endschalter, Motor 3', 'state' : 1} } m1_a1 = 17 diff --git a/src/schrittmotor.py b/src/schrittmotor.py index 1a5e646..770706a 100644 --- a/src/schrittmotor.py +++ b/src/schrittmotor.py @@ -175,7 +175,7 @@ class motor(): print(str(temp_schritte)) if temp_schritte > 0: - self.vorwaerts(temp_schritte, 1) + self.vorwaerts(temp_schritte) else: self.rueckwaerts(abs(temp_schritte))