motor test

This commit is contained in:
2021-03-04 15:53:26 +01:00
parent 2ad88bf305
commit 1d9d50d853
2 changed files with 16 additions and 11 deletions

View File

@ -137,6 +137,14 @@ class motor():
self.rueckwaerts(self.schritte_max, 1)
self.pos = 0
def gehe_zu(self, position):
temp_schritte = int(position) - self.pos
if temp_schritte > 0:
self.vorwaerts(temp_schritte)
else:
self.rueckwaerts(temp_schritte)
def einzelschritt(spule, status, ges_schritte, schritt, t1, t2):
w = (schritt * 100 / (ges_schritte - 1)) * 1.8
s = round(math.sin(math.radians(w)), 2)