*************************************** buttonAction() *************************************** by D@CC on 2022EMay30 # in IX_libr_pico.py # in testButton_pico.py # This example works with Maker Pi Pico # buttonAction() # returns True when button Action is down i.e. pressed within 10 seconds # else returns False. #imports for buttonAction #import machine #import utime def buttonAction(gPnn,withinTime): if gPnn <0 or gPnn>25: print("Error in buttonAction: 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