Skip to content

Commit

Permalink
Optimize delayed keyrate
Browse files Browse the repository at this point in the history
  • Loading branch information
feedsbrain committed Feb 19, 2021
1 parent cf550e1 commit 2dbf541
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions arduino-serial.ino
Original file line number Diff line number Diff line change
Expand Up @@ -42,34 +42,29 @@ void checkButton()

if (x < 1000)
{
delay(keyRate);
Serial.println("ECHO: x = " + String(x));
delay(keyRate);
}

if (x < 60)
{
Serial.println("BTN_RIGHT_PRESSED");
delay(keyRate);
}
else if (x < 200)
{
Serial.println("BTN_UP_PRESSED");
delay(keyRate);
}
else if (x < 400)
{
Serial.println("BTN_DOWN_PRESSED");
delay(keyRate);
}
else if (x < 600)
{
Serial.println("BTN_LEFT_PRESSED");
delay(keyRate);
}
else if (x < 800)
{
Serial.println("BTN_SELECT_PRESSED");
delay(keyRate);
}
}

Expand Down

0 comments on commit 2dbf541

Please sign in to comment.