This commit is contained in:
JChristensen
2019-06-25 19:57:01 -04:00
parent b87dcd96d9
commit 8da4933e9d
2 changed files with 7 additions and 6 deletions

View File

@@ -73,15 +73,16 @@ void loop()
} }
break; break;
case INCR: // increment the counter case INCR:
count = min(count++, MAX_COUNT); // but not more than the specified maximum ++count; // increment the counter
count = min(count, MAX_COUNT); // but not more than the specified maximum
STATE = WAIT; STATE = WAIT;
break; break;
case DECR: // decrement the counter case DECR:
count = max(count--, MIN_COUNT); // but not less than the specified minimum --count; // decrement the counter
count = max(count, MIN_COUNT); // but not less than the specified minimum
STATE = WAIT; STATE = WAIT;
break; break;
} }
} }

View File

@@ -1,5 +1,5 @@
name=JC_Button name=JC_Button
version=2.1.0 version=2.1.1
author=Jack Christensen <jack.christensen@outlook.com> author=Jack Christensen <jack.christensen@outlook.com>
maintainer=Jack Christensen <jack.christensen@outlook.com> maintainer=Jack Christensen <jack.christensen@outlook.com>
sentence=Arduino library to debounce button switches, detect presses, releases, and long presses. sentence=Arduino library to debounce button switches, detect presses, releases, and long presses.