if statement not working on new Uno board

I am thinking I just have a bad board. I just bought it and am going through a tutorial to learn how to use it. This is just making the led on the board blink with an increasing on and off time. That part works, but once I add an “if” statement to reset the counter once the delay has reached 3000 the delay period no longer increases, it continues to blink fast. I’ve tried increasing the trigger from 3000 to 100000 without any difference. I’ve reversed it like this: if (10000 < delayPeriod) delayPeriod = 100 and it hasn’t made a difference. Below is what I’m trying to use:

int ledPin = 13;
int delayPeriod = 100;

void setup()
pinMode(ledPin, OUTPUT);

void loop()
digitalWrite(ledPin, HIGH);
digitalWrite(ledPin, LOW);
delayPeriod = delayPeriod + 100;
if (delayPeriod = 100000) delayPeriod = 100;


I have also tried: if (delayPeriod > 10000)
delayPeriod = 100

and there wasn’t any difference. Am I missing something or could it just be a bad board?


int's only go to 65,535.

unsigned long delayperiod;

Thank you both. After using the double = sign it started working, even using the greater than sign works now. if delayPeriod > 3000 was not working before, but now it does.