auto rapid fire test

This commit is contained in:
2020-09-06 17:02:45 +09:00
parent 5dfbf7aae9
commit 02f2c7a2ef

View File

@@ -1,29 +1,30 @@
#include <MsTimer2.h>
#include <SwitchControlLibrary.h>
int loopCount = 0;
int state = 0;
void button() {
if (state == 0) {
SwitchControlLibrary().PressButtonA();
state = 1;
}
else {
SwitchControlLibrary().ReleaseButtonA();
state = 0;
}
}
void setup()
{
SwitchControlLibrary();
SwitchControlLibrary();
MsTimer2::set(17, button);
MsTimer2::start();
}
int loopCount = 0;
void loop()
{
if (100 < loopCount)
loopCount = 0;
if (loopCount == 50)
{
SwitchControlLibrary().PressButtonL();
SwitchControlLibrary().PressButtonR();
SwitchControlLibrary().ReleaseButtonL();
SwitchControlLibrary().ReleaseButtonR();
}
if (loopCount == 100)
{
SwitchControlLibrary().PressButtonA();
SwitchControlLibrary().ReleaseButtonA();
}
loopCount++;
}