Timer problem

    while (millis() - timeToCheck < 1000);Because of the semi-colon your program will execute this while loop for one second during which it will do nothing else.

You need to check whether the button is pressed within the while loop and take action as appropriate.