31 lines
409 B
C++
31 lines
409 B
C++
#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();
|
|
MsTimer2::set(17, button);
|
|
MsTimer2::start();
|
|
}
|
|
|
|
|
|
void loop()
|
|
{
|
|
|
|
|
|
}
|