motor test
This commit is contained in:
parent
ebbf1c1483
commit
f2e9ce00ef
@ -84,8 +84,10 @@ def action(changePin, action):
|
|||||||
@kamera_server.route("/position/<motor>/<position>")
|
@kamera_server.route("/position/<motor>/<position>")
|
||||||
def motor_test(motor, position):
|
def motor_test(motor, position):
|
||||||
if motor == "drehen":
|
if motor == "drehen":
|
||||||
#m1.stop()
|
m1.stop()
|
||||||
#m1.start()
|
time.sleep(1)
|
||||||
|
m1.start()
|
||||||
|
time.sleep(1)
|
||||||
m1.gehe_zu(int(position))
|
m1.gehe_zu(int(position))
|
||||||
|
|
||||||
return 'Drehen: ' + str(m1.pos)
|
return 'Drehen: ' + str(m1.pos)
|
||||||
@ -93,6 +95,3 @@ def motor_test(motor, position):
|
|||||||
#if __name__ == "__main__":
|
#if __name__ == "__main__":
|
||||||
# kamera_server.run(host='0.0.0.0')
|
# kamera_server.run(host='0.0.0.0')
|
||||||
application = kamera_server
|
application = kamera_server
|
||||||
|
|
||||||
try:
|
|
||||||
while True:
|
|
@ -87,7 +87,7 @@ class motor():
|
|||||||
einzelschritt(self.pwm4, 1, ges_schritte, temp_pos + 6, temp_t1, temp_t2)
|
einzelschritt(self.pwm4, 1, ges_schritte, temp_pos + 6, temp_t1, temp_t2)
|
||||||
einzelschritt(self.pwm3, 0, ges_schritte, temp_pos + 7, temp_t1, temp_t2)
|
einzelschritt(self.pwm3, 0, ges_schritte, temp_pos + 7, temp_t1, temp_t2)
|
||||||
|
|
||||||
print(str(self.pos))
|
#print(str(self.pos))
|
||||||
|
|
||||||
if self.halten == 1:
|
if self.halten == 1:
|
||||||
self.pwm4.ChangeFrequency(self.freq_halten)
|
self.pwm4.ChangeFrequency(self.freq_halten)
|
||||||
@ -126,7 +126,7 @@ class motor():
|
|||||||
einzelschritt(self.pwm4, 1, ges_schritte, temp_pos + 6, temp_t1, temp_t2)
|
einzelschritt(self.pwm4, 1, ges_schritte, temp_pos + 6, temp_t1, temp_t2)
|
||||||
einzelschritt(self.pwm1, 0, ges_schritte, temp_pos + 7, temp_t1, temp_t2)
|
einzelschritt(self.pwm1, 0, ges_schritte, temp_pos + 7, temp_t1, temp_t2)
|
||||||
|
|
||||||
print(str(self.pos))
|
#print(str(self.pos))
|
||||||
|
|
||||||
if self.halten == 1:
|
if self.halten == 1:
|
||||||
self.pwm4.ChangeFrequency(self.freq_halten)
|
self.pwm4.ChangeFrequency(self.freq_halten)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user