PWM Programming Help

Oops. I got analogWrite (0-255) and analogRead (0-1023) confused in my brain. Sorry. 128 is the correct cut-off.