Hi. I want the LED light bulb to blink incremetntally every 10 minutes. So the first time it blinks once, after 10 minutes, it blinks twice then after 20 minutes it blinks three times. I know how to get a different lightbulb to turn on after every 10 minutes but I'm struggling to understand how to do the loop and get it to work on the same LED... Can someone please help me?
Thank you so much!
const int switchPin = 8;
unsigned long previousTime = 0;
int switchState = 0;
int prevSwitchState = 0;
int led = 2;
long interval = 600000;
void setup()
{
for(int x = 2;x<8;x++){
pinMode(x, OUTPUT);
}
pinMode(switchPin, INPUT);
}
void loop() {
unsigned long currentTime = millis();
if(currentTime - previousTime > interval) {
previousTime = currentTime;
digitalWrite (led, HIGH);
led++;
if(led == 7){
}
}
switchState = digitalRead(switchPin);
if(switchState != prevSwitchState){
for(int x = 2;x<8;x++){
digitalWrite(x, LOW);
}
led = 2;
previousTime = currentTime;
}
prevSwitchState = switchState;
}
What type of LED "bulb" are you using? Are you using a relay? How long time is a "blink"?
Suppose that, instead of writing the code in loop(), you called a function. Lets say that the function is called blinkTheLEDLightBulb().
Can you figure out how to write blinkTheLEDLightBulb() function?
Can you figure out how to make the LED blink twice? Three times?
Either task is just about trivial.
I don't quite understand writing the function.. especially if it requires time interval in between,,,
If you are allowed to use external libraries, you could grab TDuino from github, and use something like this:
#include <TDuino.h>
#define LED_PIN LED_BUILTIN
#define LED_FLASH_TIME 1000
#define BLINK_INTERVAL 600000
void timerCallback(byte timerId); //Forward declaration
unsigned int numBlinks = 1; //Number of blinks
TTimer timer(timerCallback); //Timer used for timing
TPinOutput led(LED_PIN); //PinOutput used for blinking
void timerCallback(byte timerId)
{
//Set the LED to pulse with the specified interval for "numBlinks" times
led.pulse(LED_FLASH_TIME, numBlinks);
//Increment number of blinks for next time
numBlinks++;
}
void setup()
{
//Setup objects
timer.setup();
led.setup();
//Set the timer to trigger for each 10 minutes, 0 = repeat forever
timer.set(BLINK_INTERVAL, 0);
}
void loop()
{
//Loop objects
timer.loop();
led.loop();
}
The code is untested, so it may not work at all 
Hi,
Welcome to the forum.
Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.
Thanks.. Tom... 
Do you know how I might be able to stop the increment at 12? Once it goes to 12 then goes back to 1...
Ahh nevermind! I figured it out and I've been asking stupid questions. Thank you all for your help!!!
Nice that you got it sorted.. Feel free to post your final code, others may find it educational 