How to Translate a PWM pulses to standard RC values

Wawa thanks for the quick reply.

I also posted this question over on Adafruit's forum, and they gave me a quick response that solved my question. Here is the short version in case anyone else stumbles across this forum with the same problem.

Original thread: https://forums.adafruit.com/viewtopic.php?f=8&t=134384

Answer summary:

"In your setup, you need to call setPWMFreq(400). That will give you a period of 2.5 milliseconds and a pulse width resolution of about 6 nanoseconds

With a RC receiver connected to the Arduino using pulseIn(), I'm seeing a value of min 940 though max 1860.

Those numbers are in microseconds. To generate a 940 microsecond pulse within a 2.5 millisecond pulse period with 12 bit resolution, you would need an 'off' parameter of (940/2500) * 4096 = 1540. For a 1860 microsecond pulse, the 'off' parameter would be: (1860/2500) * 4096 = 3047."

Note: Use the formula above to calculate a rough estimate of the length of pulse you want. Through my testing I found it only ballparks you. Adjust the value slowly up or down till you reach the desired pulse. If you're curious what they mean by change the "off" parameter look at the first comment in the code below.

//  setPWM(channel, on, off)
pwm.setPWM(channel, 0, 2930);  // Yields a 1850 microsecond pulse.