SWButton.js module code 'makes' multiple buttons out of one hardware button

A software button (SWBtn) defined on a hardware button or pin detects sequences of short and long presses and invokes sequence related functions. For example, a long press does this, and a long press immediately followed by a short one does that. There is no limit in sequence or combination of long or short presses. SWButton defined on the onboard BTN1 button provides a multi-button user interface without adding any hardware.