The microcontroller on the Arduino UNO board, ATmega168, only supports PWM output
analogWrite() on certain pins. Calling
analogWrite() on any other pins will give high (5 volts) for values greater than 128 and low (0 volts) for values less than 128.
Older Arduino boards with an ATmega8 only support PWM output on pins 9, 10, and 11.