*********************************** # IX_libr_pico() (text) *********************************** #By D@CC #On 2021 E May 19 #Article: 164.html selectCode 06 #uSD: none #Source: unknown # This code works successfully with the Maker Pi Pico device # buttonAction(gPnn,withinTime) # returns True when button Action is down i.e. pressed within 180 seconds # else returns False. #imports for buttonAction import machine import utime #Functions Used: # buttonAction(gPnn,withinTime): # .Pin(gPnn, machine.Pin.IN) # utime.time() # button.value() # utime.sleep(0.5) # def buttonAction(gPnn,withinTime): if gPnn <0 or gPnn>25: print("Error in buttonAction: gPnn pin # is out of range") return #end if if withinTime <0 or withinTime>180: print("Error in buttonAction: withinTime is out of range") return #end if button = machine.Pin(gPnn, machine.Pin.IN) t0=utime.time() #print("t0:",t0) tDelta=0 isDown=False while tDelta