FIX : possible pb de partage d'infos entre les butons
This commit is contained in:
parent
e719b6058c
commit
b6a6c844bc
6
main.py
6
main.py
@ -14,14 +14,14 @@ def debug(str):
|
||||
|
||||
class Bouton:
|
||||
DEBOUNCE_MS = 500
|
||||
dernier_appui = 0
|
||||
on = False
|
||||
|
||||
def __init__(self, nom, pin, todo = None, pin_led = None, led_on = False):
|
||||
self.nom = nom
|
||||
self.pin = Pin(pin, Pin.IN, Pin.PULL_UP)
|
||||
self.pin.irq(trigger = Pin.IRQ_FALLING, handler = self.bouton_presse)
|
||||
self.todo = todo
|
||||
self.dernier_appui = 0
|
||||
self.on = False
|
||||
if pin_led is None:
|
||||
self.avec_led = False
|
||||
else:
|
||||
@ -183,7 +183,7 @@ def action_rouge():
|
||||
bouton_rouge.led_on()
|
||||
consigne = 80
|
||||
|
||||
bouton_rouge = Bouton("bleu", Broche[10], action_rouge, Broche[9])
|
||||
bouton_rouge = Bouton("rouge", Broche[10], action_rouge, Broche[9])
|
||||
|
||||
def action_moins():
|
||||
global consigne
|
||||
|
||||
Loading…
Reference in New Issue
Block a user