Compare commits
3 Commits
hitbox
...
c3f1842b86
| Author | SHA1 | Date | |
|---|---|---|---|
| c3f1842b86 | |||
| 8261199b9f | |||
| 5e431ffdea |
@@ -6,6 +6,7 @@
|
|||||||
int loopCount = 0;
|
int loopCount = 0;
|
||||||
int state = 0;
|
int state = 0;
|
||||||
int rapidFireTable[RapidFireTableSize];
|
int rapidFireTable[RapidFireTableSize];
|
||||||
|
bool rapidPressState = 0;
|
||||||
int index = 0;
|
int index = 0;
|
||||||
|
|
||||||
int val = 1;
|
int val = 1;
|
||||||
@@ -35,14 +36,17 @@ struct arrow newestArrow;
|
|||||||
#define ButtonInfoTableSize 9
|
#define ButtonInfoTableSize 9
|
||||||
struct ButtonInfo buttonInfoTable[ButtonInfoTableSize];
|
struct ButtonInfo buttonInfoTable[ButtonInfoTableSize];
|
||||||
|
|
||||||
|
Hat last = Hat::CENTER;
|
||||||
|
|
||||||
void perms() {
|
void perms() {
|
||||||
if(val == 0){
|
if(val == 0){
|
||||||
if (rapidFireTable[index] == 1){
|
if (rapidFireTable[index] == 1){
|
||||||
SwitchControlLibrary().PressButtonA();
|
SwitchControlLibrary().PressButtonA();
|
||||||
|
rapidPressState = true;
|
||||||
}
|
}
|
||||||
if (rapidFireTable[index] == 2){
|
if (rapidFireTable[index] == 2){
|
||||||
SwitchControlLibrary().ReleaseButtonA();
|
SwitchControlLibrary().ReleaseButtonA();
|
||||||
|
rapidPressState = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
index = (index + 1) % RapidFireTableSize;
|
index = (index + 1) % RapidFireTableSize;
|
||||||
@@ -100,7 +104,6 @@ void setup()
|
|||||||
oldestArrow.arrowSymbol = Hat::CENTER;
|
oldestArrow.arrowSymbol = Hat::CENTER;
|
||||||
newestArrow.older = &oldestArrow;
|
newestArrow.older = &oldestArrow;
|
||||||
newestArrow.newer = NULL;
|
newestArrow.newer = NULL;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void handleButtonInput(ButtonInfo *but){
|
void handleButtonInput(ButtonInfo *but){
|
||||||
@@ -121,10 +124,13 @@ void loop()
|
|||||||
val = digitalRead(2);
|
val = digitalRead(2);
|
||||||
if(prevVal == 1 && val == 0){
|
if(prevVal == 1 && val == 0){
|
||||||
SwitchControlLibrary().PressButtonA();
|
SwitchControlLibrary().PressButtonA();
|
||||||
|
rapidPressState = true;
|
||||||
index = 1;
|
index = 1;
|
||||||
}
|
}
|
||||||
else if(prevVal == 0 && val == 1){
|
else if(prevVal == 0 && val == 1){
|
||||||
SwitchControlLibrary().ReleaseButtonA();
|
if(rapidPressState){
|
||||||
|
SwitchControlLibrary().ReleaseButtonA();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
prevVal = val;
|
prevVal = val;
|
||||||
|
|
||||||
@@ -152,8 +158,10 @@ void loop()
|
|||||||
arrowTable[i].prev = arrowTable[i].current;
|
arrowTable[i].prev = arrowTable[i].current;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(newestArrow.older->arrowSymbol != last){
|
||||||
SwitchControlLibrary().MoveHat(static_cast<uint8_t>(newestArrow.older->arrowSymbol));
|
last = newestArrow.older->arrowSymbol;
|
||||||
|
SwitchControlLibrary().MoveHat(static_cast<uint8_t>(newestArrow.older->arrowSymbol));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
panel/20200912.pdf
Normal file
BIN
panel/20200912.pdf
Normal file
Binary file not shown.
211
panel/20200912.svg
Normal file
211
panel/20200912.svg
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 1.2 MiB |
BIN
panel/20201101.pdf
Normal file
BIN
panel/20201101.pdf
Normal file
Binary file not shown.
235
panel/20201101.svg
Normal file
235
panel/20201101.svg
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 1.2 MiB |
Reference in New Issue
Block a user