Expanded verbose options
This commit is contained in:
@@ -16,8 +16,9 @@ class Button:
|
||||
presstime=0
|
||||
ignore=0
|
||||
|
||||
def __init__(self, gpio):
|
||||
print("initialize button on gpio %d" %gpio)
|
||||
def __init__(self, gpio,verbose=False):
|
||||
if verbose:
|
||||
print("initialize button on gpio %d" %gpio)
|
||||
self.gpio = gpio
|
||||
GPIO.setup(self.gpio, GPIO.IN, pull_up_down = GPIO.PUD_UP)
|
||||
GPIO.add_event_detect(self.gpio, GPIO.BOTH, callback=self.my_callback)
|
||||
|
||||
Reference in New Issue
Block a user