reading digital INPUT for 30 sec: at least one 1

You could just use the millis() function to track passage of time and along with proper standard code to accomplish that.

Lefty