Last active
January 21, 2018 22:38
-
-
Save Youz13/286325326c6db9bd3c2a7af8f4f71fc6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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