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(); | |
} |
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
analogWrite(10, 30); delay(200); analogWrite(10, 0); delay(300); analogWrite(10, 30); delay(200); analogWrite(10, 0); delay(1000); // blink 2 times when arduino boot finish | |
while (cyclecompt < 500) { // check for 5 seconds the number of time mode button is pushed | |
buttonState = digitalRead(mode); | |
if (buttonState != lastButtonState) { | |
if (buttonState == HIGH) { | |
buttonCounter++; | |
delay(200); | |
} | |
} |
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
/* | |
FADing : version 1.0 | |
Made by : Youz | |
1- Push ON button to power up until you see 1 flash. | |
2- To add more minutes to the process, you have 5 seconds to add 2 more minutes for each push on the "mode" button. | |
3- To switch betwin top light or inside light, quick push the "mode" button. | |
4- To shutdown, long push the "mode" button. | |
*/ |
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
cyclecompt = 0; | |
while (cyclecompt < 220) { | |
analogWrite(led, brightness); | |
brightness = brightness + fadeAmount; | |
if ( brightness <= 10 ) { // On ending invert fadeAmount for next fade in | |
fadeAmount = -fadeAmount; | |
delay(1000); | |
} | |
if ( brightness >= 115 ) { // If led is full bright, invert fadeAmount to fade out | |
fadeAmount = -fadeAmount; |