Compare commits
1 Commits
266143d5fc
...
11a55cf446
Author | SHA1 | Date |
---|---|---|
fluffy | 11a55cf446 |
|
@ -13,7 +13,7 @@
|
||||||
//! Debounce time in milliseconds
|
//! Debounce time in milliseconds
|
||||||
constexpr int debounceTime = 50;
|
constexpr int debounceTime = 50;
|
||||||
|
|
||||||
//! Input button
|
//!
|
||||||
struct Input {
|
struct Input {
|
||||||
int pin; //!< Input pin
|
int pin; //!< Input pin
|
||||||
int keyCode; //!< Mapped key
|
int keyCode; //!< Mapped key
|
||||||
|
@ -68,6 +68,7 @@ void loop()
|
||||||
bool val = !digitalRead(i.pin);
|
bool val = !digitalRead(i.pin);
|
||||||
if (val != i.pressed && (i.lastChange + debounceTime) < now) {
|
if (val != i.pressed && (i.lastChange + debounceTime) < now) {
|
||||||
if (val) {
|
if (val) {
|
||||||
|
// TODO debounce
|
||||||
Keyboard.press(i.keyCode);
|
Keyboard.press(i.keyCode);
|
||||||
} else {
|
} else {
|
||||||
Keyboard.release(i.keyCode);
|
Keyboard.release(i.keyCode);
|
||||||
|
|
Loading…
Reference in New Issue