From 79b9e28ae538aeba6f41b6146c84289cb7be8d8d Mon Sep 17 00:00:00 2001 From: sirrow Date: Sun, 13 Sep 2020 15:32:59 +0900 Subject: [PATCH] add B button --- connect_switch.ino | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/connect_switch.ino b/connect_switch.ino index 1ba3a54..9d8e210 100644 --- a/connect_switch.ino +++ b/connect_switch.ino @@ -16,8 +16,17 @@ struct arrow { int state; }; +struct button { + int pinNumber; + bool prev; + bool current; +}; + struct arrow arrowTable[4]; +#define ButtonTableLength 1 +struct button buttonTable[ButtonTableLength]; + void perms() { if(val == 0){ if (table[index] == 1){ @@ -47,9 +56,17 @@ void setup() table[0] = 1; table[tableSize/2] = 2; SwitchControlLibrary(); + MsTimer2::set(1, perms); MsTimer2::start(); + buttonTable[0].pinNumber = 3; + for (int i; i