def main(): limitPin = 23 gpio.setMode(limitPin, "in") while True: if gpio.read(limitPin) == gpio.LOW: # <1> print("Touch detected!") time.sleep(0.5)
def readLimit(): limitPin = 23 gpio.setMode(limitPin, "in") return gpio.read(limitPin)
def readLimit(): limitPin = 23 gpio.setMode(limitPin,"in") return gpio.read(limitPin)