Compare commits

..

2 Commits

Author SHA1 Message Date
c3f1842b86 omit sending hat if direction is not changed 2021-01-01 21:33:14 +09:00
8261199b9f remove .vscode 2020-11-18 18:10:17 +09:00
3 changed files with 5 additions and 28 deletions

View File

@@ -1,7 +0,0 @@
{
"board": "SparkFun:avr:promicro",
"programmer": "AVR ISP",
"port": "COM11",
"sketch": "connect_switch.ino",
"configuration": "cpu=16MHzatmega32U4"
}

View File

@@ -1,18 +0,0 @@
{
"configurations": [
{
"name": "Win32",
"includePath": [
"C:\\Users\\sirrow\\AppData\\Local\\Arduino15\\packages\\SparkFun\\hardware\\avr\\1.1.13\\**",
"C:\\Users\\sirrow\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\**",
"C:\\Users\\sirrow\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.2\\**"
],
"forcedInclude": [],
"intelliSenseMode": "msvc-x64",
"compilerPath": "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.24.28314/bin/Hostx64/x64/cl.exe",
"cStandard": "c11",
"cppStandard": "c++17"
}
],
"version": 4
}

View File

@@ -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<uint8_t>(newestArrow.older->arrowSymbol));
if(newestArrow.older->arrowSymbol != last){
last = newestArrow.older->arrowSymbol;
SwitchControlLibrary().MoveHat(static_cast<uint8_t>(newestArrow.older->arrowSymbol));
}
}