def __init__(self, button_pin=12):
self.button_pin = button_pin
GPIO.setmode(GPIO.BOARD) # Numbers GPIOs by physical location
GPIO.setup(button_pin, GPIO.IN, pull_up_down=GPIO.PUD_UP) # Set button_pin's mode is input, and pull up to high level(3.3V)
pass
评论列表
文章目录