Hey there, currently I am running a python script that uses a button attached to the GrovePi using a screw terminal. Until now it had only one function in each “mode”, however I would like to add short and long press functions without (further) delaying the program. Any thoughts on this?
Currently this is my function to read the button:
def pushcallback(): readingpush = grovepi.digitalRead(pinpushbutton) time.sleep(0.2) if (readingpush == grovepi.digitalRead(pinpushbutton)): return readingpush