Project 09 (Motorized Pinwheel) problem - motor spins forever

I realize this is an old topic, but the problem is apparently perennial because I just experienced it today. In my case the error was in my copying over of the software. Where the code should say...

if (switchState == HIGH) {

I had a single equal sign (=) rather than a double equal sign (==). Instead of a comparison I was making a variable assignment, which always returned TRUE. It's valid code, so the error wouldn't be caught by the compiler, and it made the motor run under any condition.