analogWrite() question

Amorri, the "if" statement is performing your analog write function ONLY when the compare == (is equal to 0). As soon as the compare is NOT equal to 0 (it's pretty quick), the if statement returns FALSE. Probably why your analogWrite stops.

For the heck of it, change the == to != (not equal) and see what happens.