currentTime doesn't have to be a global variable. You could remove the line `unsigned long currentTi - Arduino