time lapse dolly code problems

Are you sure this is what you wanna do?

Why not? That assigns the value read from the pin to the variable, and then compares the result of that assignment (the value assigned) to HIGH.