I'm guessing the interval value is now being ignored because currentMillis - previousMillis is always greater than interval
But, only once, when the switch is pressed. I don't you see you resetting previousMillis when pressed is set to true.
I'm guessing the interval value is now being ignored because currentMillis - previousMillis is always greater than interval
But, only once, when the switch is pressed. I don't you see you resetting previousMillis when pressed is set to true.