Get professional PCBs for low prices from www.pcbway.com -~-
In this video we look at one way to detect single, double, and long button presses with your Arduino. We use the OneButton library by Mattias Hertel. This library lets the user detect diferent presses with a single command and go to function based on the button press.
My Code:
https://pastebin.com/xEr5kV5j
OneButton Library: https://github.com/mathertel/OneButton