Added logic that waits a second (a given time) at the beginning of auto before checking the PI