hey im new to arduino and need some help :)

so basicly i am coding a program for my arduino that blink led 13 for 1 second and then delays for a second and then turns the led on for 2 seconds and so on, if u did not understand me try looking at the code :stuck_out_tongue:

btw my problem is that when i run my code it just turn the led on and stays on :stuck_out_tongue:

my code:

int delayer = 1000;
int checksum = 6;
int counter = 0;

void setup()
{
pinMode(13, OUTPUT);
}

void loop()
{
if (counter == checksum)
{
digitalWrite(13, LOW);
delay(3000);
delayer = 1000;
counter = 0;
}
else
{
digitalWrite(13, HIGH);
delay (delayer);
digitalWrite(13, LOW);
delayer + 1000;
counter + 1;
}

}

plzz help a noob, thanks in advance <3

~disturbed

After you write the LED low, you don't delay, so loop repeats and writes it high again.

I noticed that and fixed it, but now my last issue is that the "delayer" variable won't add 1 second for ea time that it loops through the code so the program does this

led on for 1 second
led off for 1 seond
loop

and i ant it to do this

led on for 1 second
led off for 1 second
led on for 2 seconds
led off for 1 second

and then loop through and increase amount of on for ea loop

@disturbed

I notice a few mistakes... I hope I understand the logic off that program.

void loop()
{
  if (counter == checksum)
  {
    digitalWrite(13, LOW);
    delay(3000);
    delayer = 1000;
    counter = 0;
  }
  else
  {
    digitalWrite(13, HIGH);
    delay (delayer);
    digitalWrite(13, LOW);
    delayer + 1000;  <--- delayer = delayer +1000;
    counter + 1;  < --- counter++;  or counter=counter+1;
  }
 
}

Thank you, this really help me out alot.