- redefine activate method

- for task introduced open() conext method
This commit is contained in:
jens
2020-12-18 15:58:02 +01:00
parent a3510ffe8f
commit 4e508c86c5
9 changed files with 85 additions and 62 deletions
+2 -4
View File
@@ -47,15 +47,13 @@ class StirrerPololu1376(AStirrer):
return self.speed
return 0
def on_activate(self, enable):
def activate(self, enable):
print("activate {}".format(enable))
if enable:
self.ser_send("go")
self.set_speed(self.speed)
else:
self.ser_send("X")
print("on_activate {}".format(enable))
def on_set_speed(self, speed):
self.ser_send("F" + str(int(speed)) + "%")
print("Set speed to {} %".format(speed))