diff --git a/connect_switch.ino b/connect_switch.ino index 6e93d93..4f6e058 100644 --- a/connect_switch.ino +++ b/connect_switch.ino @@ -36,6 +36,7 @@ struct arrow newestArrow; #define ButtonInfoTableSize 9 struct ButtonInfo buttonInfoTable[ButtonInfoTableSize]; +Hat last = Hat::CENTER; void perms() { if(val == 0){ @@ -103,7 +104,6 @@ void setup() oldestArrow.arrowSymbol = Hat::CENTER; newestArrow.older = &oldestArrow; newestArrow.newer = NULL; - } void handleButtonInput(ButtonInfo *but){ @@ -158,8 +158,10 @@ void loop() arrowTable[i].prev = arrowTable[i].current; } - - SwitchControlLibrary().MoveHat(static_cast(newestArrow.older->arrowSymbol)); + if(newestArrow.older->arrowSymbol != last){ + last = newestArrow.older->arrowSymbol; + SwitchControlLibrary().MoveHat(static_cast(newestArrow.older->arrowSymbol)); + } }