testing for a pushed button switch

It would help to see your code.

One thing, easy, that you could do is stay in setup() until the switch is pressed, using a while loop. When the switch is pressed, break out of the while loop, which will let setup() end and loop() to begin looping.