Using Millis with optical encoder

Do you need to maintain temp? You could reset it to 0 and see it count to 100 again.

Or use another counter, and reset that one. Every 100 when you fire off the LED.

Or notice that temp % 100 (modulo operator) will be zero as temp crosses the 100s marks.

if (temp % 100 == 0) …

a7