PWM pins in the diagram have the same tilde sign in front ... To send a PWM value to a PWM-capable pin like the Mega's D9, the easiest and most common way is by using the analogWrite() function.