analogWrite 0–255
Set duty cycle to control LED brightness.
The Command That Does PWM
To produce PWM you call one function: analogWrite. You give it a pin and a level, and the chip handles the fast pulsing for you.
analogWrite(9, 200);The Value Range Is 0 to 255
The second argument goes from 0 to 255. That is 256 steps, because one byte holds exactly that many values.