diff --git a/connect_switch.ino b/connect_switch.ino index 41a3d39..edd5352 100644 --- a/connect_switch.ino +++ b/connect_switch.ino @@ -3,7 +3,20 @@ int loopCount = 0; int state = 0; +int table[40] = {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; +int index = 0; +void perms() { + if (table[index] == 1){ + SwitchControlLibrary().PressButtonA(); + } + if (table[index] == 2){ + SwitchControlLibrary().ReleaseButtonA(); + } + + index = (index + 1) % 40; +} +/* void button() { if (state == 0) { SwitchControlLibrary().PressButtonA(); @@ -14,11 +27,12 @@ void button() { state = 0; } } +*/ void setup() { SwitchControlLibrary(); - MsTimer2::set(20, button); + MsTimer2::set(1, perms); MsTimer2::start(); }