Skip to content

Instantly share code, notes, and snippets.

@Youz13
Last active January 21, 2018 22:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Youz13/286325326c6db9bd3c2a7af8f4f71fc6 to your computer and use it in GitHub Desktop.
Save Youz13/286325326c6db9bd3c2a7af8f4f71fc6 to your computer and use it in GitHub Desktop.
if (start == 1) { // Run startup loop
StarT();
}
if ( millis() >= temps + 10000 ) { // every 10 seconds, fade in/fade out slow down
delayM = delayM + intervaL;
temps = temps + 10000;
}
if ( temps > md2 * 60000 ) { // check if the selected number of minutes is reach
EnD();
}
cycle(); // run 1 fade in and 1 fade out step
}
else {
md2 = initTime + ( buttonCounter * 2 ); // Add 2 minutes per push of the mode button
}
intervaL = 21.0 / ( (float)md2 * 6.0 ); //21 is the interval between brightness change from starting 11 breath per minute (20 ms) to ending 6 breath per minute (41 ms)
start = 0;
if ( md2 != initTime ) { // blink the number of time mode button is pushed
cyclecompt = 1;
while (cyclecompt < buttonCounter + 1) {
analogWrite(10, 50); delay(200); analogWrite(10, 0); delay(300);
cyclecompt++;
}
delay(800);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment