Rc Receiver to a variable

Read a pulse's length
Map a number to a different range

AWOL:
Read a pulse's length
Map a number to a different range

Does pulsein work with PWM?

Does pulsein work with PWM?

For what purpose?

Does pulsein work with PWM?

The great thing about Arduino is, it allows you to try things out, very rapidly.
But another answer is "it depends on the frequency of the PWM"

PaulS:

Does pulsein work with PWM?

For what purpose?

Read the OP, I would like to take the PWM input (to arduino) and translate it to a variable so I can easily use my RC transmitter/receiver.

Yes, you can do that.
You can read the PWM out of one of the Arduino's pins

Hi,

have a look here, there is a lot about reading RC receivers, the whole site is bought RC and arduino.

Duane b
rcarduino.blogspot.com

Read the OP, I would like to take the PWM input (to arduino) and translate it to a variable so I can easily use my RC transmitter/receiver.

I read the OP. The output of an RC transmitter is NOT PWM. Get over it.

PaulS:

Read the OP, I would like to take the PWM input (to arduino) and translate it to a variable so I can easily use my RC transmitter/receiver.

I read the OP. The output of an RC transmitter is NOT PWM. Get over it.

I though it would be.
Since its original use it controlling a servo (which is pwm)

Since its original use it controlling a servo (which is pwm)

No, servos do NOT use PWM. Where did you get that idea?

Actually, they do use PWM.
The stream between Tx and Rx is PPM, but once the stream is past the demultiplexer and on its way to the servo or ESC, it's PWM.
Get over it.
I did.

AWOL:
Actually, they do use PWM.
The stream between Tx and Rx is PPM, but once the stream is past the demultiplexer and on its way to the servo or ESC, it's PWM.
Get over it.
I did.

Thank you,
So is there an easy way to 'read' the pwm to a 0-180 variable?

See reply #1

AWOL:
See reply #1

Would it be anything like the potentiometer example sketch?

No, simply pass the output of pulse in into map.

The stream between Tx and Rx is PPM, but once the stream is past the demultiplexer and on its way to the servo or ESC, it's PWM.
Get over it.
I did.

Then, how is it that servos can be connected to other than PWM pins, and still operate. The Servo library is not doing soft-PWM, is it?

Just because the Servo library doesn't do 490Hz 0-100% PWM doesn't make it any less PWM.
The position of the servo or speed of the ESC (which may itself output a different frequency and duty cycle PWM) is proportional to the width of the pulse, hence Pulse Width Modulation.

AWOL:
No, simply pass the output of pulse in into map.

Would you mind giving some example code?

int servoAngle = map ( pulseIn (rxPin, HIGH), 540, 2400, 0, 180);

Of course, you may have to play with the constants.
Even do some preprocessing, but, as I said, that's the gist.