I am trying to make a ACNH auto nook mile collector. I wrote the code for my Leonardo to control my switch automatically to earn nook miles by running to the terminal collect my 7+500 nook mile reword but my Arduino is not running the code how I wrote it. can any butty tell me what im doing wrong.
#include "SwitchJoystick.h"
// Create pro_controller
SwitchJoystick_ pro_controller;uint32_t timer = 0;
int num = 0;// Set to true to test "Auto Send" mode or false to test "Manual Send" mode.
void setup() {
pro_controller.begin();// Set to null to test "Auto Send" mode or false to test "Manual Send" mode.
pro_controller.setXAxis(128);
pro_controller.setYAxis(128);
pro_controller.setZAxis(128);
pro_controller.setRzAxis(128);
pro_controller.releaseButton(0); // Y
pro_controller.releaseButton(1); // B
pro_controller.releaseButton(2); // A
pro_controller.releaseButton(3); // X
pro_controller.releaseButton(4); // L
pro_controller.releaseButton(5); // R
pro_controller.releaseButton(6); // Zl
pro_controller.releaseButton(7); // Zr
pro_controller.releaseButton(8); // -
pro_controller.releaseButton(9); // +
pro_controller.releaseButton(10); // Lstick
pro_controller.releaseButton(11); // Rstick
pro_controller.releaseButton(12); // Home
pro_controller.releaseButton(13); // capture
pro_controller.setHatSwitch(-1); // RELEASE
pro_controller.sendState();
}void loop() {
if (millis() > timer) {
timer = millis() + 10; // 10 ms = 1/0.010 == 100Hz
if(num==0){
pro_controller.pressButton(4); // L
pro_controller.pressButton(5); // R
pro_controller.releaseButton(4); // L
pro_controller.releaseButton(5); // R
pro_controller.pressButton(2); // A
pro_controller.releaseButton(2); // A
pro_controller.pressButton(2); // A
pro_controller.releaseButton(2); // A
pro_controller.pressButton(2); // A
pro_controller.releaseButton(2); // A
pro_controller.pressButton(2); // A
pro_controller.releaseButton(2); // A
}
pro_controller.pressButton(8); // -
pro_controller.releaseButton(8); // -
delay(1990);
pro_controller.pressButton(2); // A
pro_controller.releaseButton(2); // A
delay(1500);
pro_controller.pressButton(2); // A
pro_controller.releaseButton(2); // A
delay(13000);
pro_controller.pressButton(12); // Home
pro_controller.releaseButton(12); // Home
delay(1300);
pro_controller.pressButton(3); // X
pro_controller.releaseButton(3); // X
delay(860);
pro_controller.pressButton(2); // A
pro_controller.releaseButton(2); // A
delay(3650);
pro_controller.setHatSwitch(180); // DOWN
pro_controller.setHatSwitch(-1); // RELEASE
for(int i=0; i<5;i++){
pro_controller.setHatSwitch(90); // RIGHT
pro_controller.setHatSwitch(-1); // RELEASE
}
pro_controller.pressButton(2); // A
pro_controller.releaseButton(2); // A
delay(1630);
for(int i=0; i<15;i++){
pro_controller.setHatSwitch(180); // DOWN
pro_controller.setHatSwitch(-1); // RELEASE
}
pro_controller.setHatSwitch(90); // RIGHT
pro_controller.setHatSwitch(-1); // RELEASE
for(int i=0; i<7;i++){
pro_controller.setHatSwitch(180); // DOWN
pro_controller.setHatSwitch(-1); // RELEASE
}
pro_controller.pressButton(2); // A
pro_controller.releaseButton(2); // A
for(int i=0; i<2;i++){
pro_controller.setHatSwitch(180); // DOWN
pro_controller.setHatSwitch(-1); // RELEASE
}
pro_controller.pressButton(2); // A
pro_controller.releaseButton(2); // A
for(int i=0; i<2;i++){
pro_controller.setHatSwitch(90); // RIGHT
pro_controller.setHatSwitch(-1); // RELEASE
}
if(num==0){
for(int i=0; i<60;i++){
pro_controller.setHatSwitch(0); // UP
pro_controller.setHatSwitch(-1); // RELEASE
num++;
}
}else{
pro_controller.setHatSwitch(180); // DOWN
pro_controller.setHatSwitch(-1); // RELEASE
}
for(int i=0; i<4;i++){
pro_controller.setHatSwitch(90); // RIGHT
pro_controller.setHatSwitch(-1); // RELEASE
}
pro_controller.pressButton(2); // A
pro_controller.releaseButton(2); // A
pro_controller.pressButton(12); // Home
pro_controller.releaseButton(12); // Home
pro_controller.pressButton(2); // A
pro_controller.releaseButton(2); // A
for(int i = 0;i<8;i++){
pro_controller.setHatSwitch(270); // LEFT
pro_controller.setHatSwitch(-1); // RELEASE
}
pro_controller.setHatSwitch(90); // RIGHT
pro_controller.setHatSwitch(-1); // RELEASE
pro_controller.pressButton(2); // A
pro_controller.releaseButton(2); // A
delay(50560);
pro_controller.pressButton(2); // A
pro_controller.releaseButton(2); // A
pro_controller.pressButton(1); // B
for(int i=0;i<100;i++){
pro_controller.pressButton(2); // A
pro_controller.releaseButton(2); // A
}
pro_controller.releaseButton(1); // B
pro_controller.setXAxis(255); // Left pro_controller RIGHT
delay(4920);
pro_controller.setXAxis(128); // Release
pro_controller.setYAxis(0); // Left pro_controller UP
delay(1710);
pro_controller.setYAxis(128); // Release
pro_controller.pressButton(2); // A
pro_controller.releaseButton(2); // A
pro_controller.setYAxis(0); // Left pro_controller UP
delay(500);
pro_controller.setYAxis(128); // Release
pro_controller.setXAxis(255); // Left pro_controller RIGHT
delay(1630);
pro_controller.setXAxis(128); //
pro_controller.pressButton(2); // A
pro_controller.releaseButton(2); // A
delay(3120);
pro_controller.pressButton(2); // A
pro_controller.releaseButton(2); // A
delay(2530);
pro_controller.pressButton(2); // A
pro_controller.releaseButton(2); // A
delay(1420);
pro_controller.pressButton(2); // A
pro_controller.releaseButton(2); // A
delay(3310);
pro_controller.pressButton(2); // A
pro_controller.releaseButton(2); // A
delay(2880);
pro_controller.pressButton(2); // A
pro_controller.releaseButton(2); // A
delay(6380);
pro_controller.pressButton(2); // A
pro_controller.releaseButton(2); // A
delay(2830);
pro_controller.pressButton(2); // A
pro_controller.releaseButton(2); // A
delay(2250);
pro_controller.pressButton(2); // A
pro_controller.releaseButton(2); // A
delay(1050);
pro_controller.pressButton(1); // B
pro_controller.releaseButton(1); // B
pro_controller.pressButton(1); // B
pro_controller.releaseButton(1); // B
pro_controller.pressButton(1); // B
pro_controller.releaseButton(1); // B
pro_controller.pressButton(1); // B
pro_controller.releaseButton(1); // B
pro_controller.pressButton(1); // B
pro_controller.releaseButton(1); // B
pro_controller.sendState();
}
}