fix mixgo button
@@ -45,10 +45,13 @@ class Button:
def was_pressed(self):
last_state = self.pin.value()
- time.sleep_ms(15)
- if last_state == 1 and self.pin.value() == 0:
- return True
+ if last_state :
return False
+ else :
+ while not self.pin.value():
+ time.sleep_ms(10)
+ return True
+
def irq(self, handler, trigger):
self.pin.irq(handler = handler, trigger = trigger)
