-
-
Notifications
You must be signed in to change notification settings - Fork 49
Closed as not planned
Closed as not planned
Assignees
@drf5n
Description
arduino-examples/examples/10.StarterKit_BasicKit/p08_DigitalHourglass/p08_DigitalHourglass.ino
Lines 47 to 60 in 2c2bb7b
if (currentTime - previousTime > interval) {
// save the current time as the last time you changed an LED
previousTime = currentTime;
// Turn the LED on
digitalWrite(led, HIGH);
// increment the led variable
// in 10 minutes the next LED will light up
led++;
if (led == 7) {
// the hour is up
}
}
Note that the code in the Digital Hourglass example starts cycling above pin 7 after the hour is up, setting pins to low and essentially setting the pinMode(switchPin,INPUT_PULLUP), overriding the external pulldown, and making the button non-functional.
The code should either reset the hourglass automatically, or check that it is in the 2-7 range before setting the pin to low.
Maybe change the test to:
if (currentTime - previousTime > interval && led <= 7 ) {
Sped-up (6 seconds/step) Example: