Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a power LEDthat is turned on when the system starts and goes off when the system enters standby #78

Open
wants to merge 1 commit into
base: DEV
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Tonuino.ino
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
// uncomment the below line to enable five button support
//#define FIVEBUTTONS

// uncomment the below line to enable a power led (by default at pin D5)
//#define POWERLED

static const uint32_t cardCookie = 322417479;

// DFPlayer Mini
Expand Down Expand Up @@ -650,6 +653,10 @@ MFRC522::StatusCode status;
#define buttonFivePin A4
#endif

#ifdef POWERLED
#define powerLedPin 5
#endif

#define LONG_PRESS 1000

Button pauseButton(buttonPause);
Expand Down Expand Up @@ -686,6 +693,9 @@ void disablestandbyTimer() {
void checkStandbyAtMillis() {
if (sleepAtMillis != 0 && millis() > sleepAtMillis) {
Serial.println(F("=== power off!"));
#ifdef POWERLED
digitalWrite(powerLedPin, LOW);
#endif
// enter sleep state
digitalWrite(shutdownPin, HIGH);
delay(500);
Expand Down Expand Up @@ -719,6 +729,10 @@ void waitForTrackToFinish() {
}

void setup() {
#ifdef POWERLED
pinMode(powerLedPin, OUTPUT);
digitalWrite(powerLedPin, HIGH);
#endif

Serial.begin(115200); // Es gibt ein paar Debug Ausgaben über die serielle Schnittstelle

Expand Down