I wonder if you should be initializing "previousState" and "previousMillis" in your constructor (or in a .begin() function is that is where you are going to move the pinMode() calls).
I wonder if you should be initializing "previousState" and "previousMillis" in your constructor (or in a .begin() function is that is where you are going to move the pinMode() calls).