Compare commits
1 Commits
5e431ffdea
...
norapid
| Author | SHA1 | Date | |
|---|---|---|---|
| 7539e3658a |
7
.vscode/arduino.json
vendored
7
.vscode/arduino.json
vendored
@@ -1,7 +0,0 @@
|
|||||||
{
|
|
||||||
"board": "SparkFun:avr:promicro",
|
|
||||||
"programmer": "AVR ISP",
|
|
||||||
"port": "COM11",
|
|
||||||
"sketch": "connect_switch.ino",
|
|
||||||
"configuration": "cpu=16MHzatmega32U4"
|
|
||||||
}
|
|
||||||
18
.vscode/c_cpp_properties.json
vendored
18
.vscode/c_cpp_properties.json
vendored
@@ -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
|
|
||||||
}
|
|
||||||
@@ -6,7 +6,6 @@
|
|||||||
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;
|
||||||
@@ -41,11 +40,9 @@ 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;
|
||||||
@@ -66,8 +63,8 @@ void setup()
|
|||||||
rapidFireTable[RapidFireTableSize/2] = 2;
|
rapidFireTable[RapidFireTableSize/2] = 2;
|
||||||
SwitchControlLibrary();
|
SwitchControlLibrary();
|
||||||
|
|
||||||
MsTimer2::set(1, perms);
|
//MsTimer2::set(1, perms);
|
||||||
MsTimer2::start();
|
//MsTimer2::start();
|
||||||
|
|
||||||
setupButton(&(buttonInfoTable[0]), 3, Button::B);
|
setupButton(&(buttonInfoTable[0]), 3, Button::B);
|
||||||
setupButton(&(buttonInfoTable[1]), 4, Button::X);
|
setupButton(&(buttonInfoTable[1]), 4, Button::X);
|
||||||
@@ -124,13 +121,10 @@ 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){
|
||||||
if(rapidPressState){
|
SwitchControlLibrary().ReleaseButtonA();
|
||||||
SwitchControlLibrary().ReleaseButtonA();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
prevVal = val;
|
prevVal = val;
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 1.2 MiB |
Binary file not shown.
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 1.2 MiB |
Reference in New Issue
Block a user