Compiled project not uploading

Hello… I am doing a blinking LED light program and I cannot upload the code. The Arduino board receives the code, but the light doesn’t blink the way I want it to. Can someone please help me how I can make it work?

Here is my code for reference:

#define LED13;

const unsigned long eventInterval = 1000;
unsigned long previousTime = 0;
void setup()
// put your setup code here, to run once:
{
Serial.begin(9600);
pinMode (13, OUTPUT);
}
// probably needs loop here:
void loop()
{
unsigned long currentTime = millis( );
if (currentTime - previousTime >= eventInterval)
{
digitalWrite (13, HIGH);
}

if (previousTime = currentTime); <<< needs == for a comparison
{
digitalWrite(LED13, LOW);
}
} // needs this to end loop()

Thank you in advance

how do you expect the led to blink ?

It looks like you may have forgotten to assign a value to LED13 in your #define statement.

Thank you everyone for your help. However, the project is still not working. I made the changes to the project, and this is how it looks like.

#define LED 13

const unsigned long eventInterval = 1000;
unsigned long previousTime = 0;
void setup()
// put your setup code here, to run once:
{
Serial.begin(9600);
pinMode (LED, OUTPUT);
}
// probably needs loop here:
void loop()
{
unsigned long currentTime = millis( );
if (currentTime - previousTime >= eventInterval)
{
digitalWrite (LED, HIGH);
}

if (previousTime = currentTime);
{
digitalWrite(LED, LOW);
}
} // needs this to end loop()

if (previousTime = currentTime);Oops2

Now the LED is on but not blinking

What did you do?

#define LED 13

const unsigned long eventInterval = 1000;
unsigned long previousTime = 0;
void setup()
// put your setup code here, to run once:
{
Serial.begin(9600);
pinMode (LED, OUTPUT);
}
// probably needs loop here:
void loop()
{
unsigned long currentTime = millis( );
if (currentTime - previousTime >= eventInterval)
{
digitalWrite (LED, HIGH);
}

if (previousTime == currentTime);
{
digitalWrite(LED, LOW);
}
} // needs this to end loop()

This is what I did

previousTime never gets changed from its initial value of zero. Your code that turns the LED off won't get executed.

if (previousTime == currentTime);Oops

Please remember to use code tags when posting code

#define LED 13

const unsigned long eventInterval = 1000;
unsigned long previousTime = 0;
void setup()
// put your setup code here, to run once:
{
Serial.begin(9600);
pinMode (LED, OUTPUT);
}
// probably needs loop here:
void loop()
{
unsigned long currentTime = millis( );
if (currentTime - previousTime >= eventInterval)
{
digitalWrite (LED, HIGH);
}

if (previousTime == currentTime);
{
digitalWrite(LED, LOW);
}
} // needs this to end loop() ``

You will need to wait a while to see the output go LOW, a bit over 49 days. As was pointed out, you never change the value of previousTime, which was initialized to 0, so the only time you will have previousTime == currentTime is when the millis() counter overflows, which occurs at slightly over 49 day intervals.

Have a look at the BlinkWithoutDelay example in the IDE.

You may have to wait substantially longer than 49ish days for the comparison to be true. The comparison relies on calling millis() at the precise moment it overflows back to zero which may take several years to hit precisely.

Try this version

#define LED 13

const unsigned long eventInterval = 1000;
unsigned long previousTime = 0;
byte ledState = 0;

void setup()
// put your setup code here, to run once:
{
  Serial.begin(9600);
  pinMode (LED, OUTPUT);
}
// probably needs loop here:
void loop()
{
  unsigned long currentTime = millis( );
  if (currentTime - previousTime >= eventInterval)
  {
    ledState = 1 - ledState; // result is 1, 0, 1, 0 ...
    previousTime = previousTime + eventInterval;
    digitalWrite (LED, ledState);
    Serial.println (previousTime);
  }
} // needs this to end loop()

Same test using micros(), want to see observe the rollover in ~ 71.58 minutes.

Interesting, not quite what I was expecting to see ...

Ok, so 2^32 - 4294000000 + 32704 = 1,000,000.
So that does indeed seem to be correct.

Rollover #2. Nice & smooth, 'excess' value as expected, 2 x 32074 = 65,408

And #3, as expected, excess * 3.

Thank you, everyone! The LED is blinking thanks to all of your help!