This message was posted on behalf of Intel Corporation
You could use the analogWrite() method. It sets a PWM output signal the PWM pin that you select. Additional information about this method can be found in the following site: https://www.arduino.cc/en/Reference/AnalogWrite
Also, you could check the following example, it sets the frequency and duty cycle of the PWM signal:
Let me know if it helps.