RC reciever to analog 0-5 voltage

If you want to miss more than half of the information in the RC Signal this is fine.

If your interested in why you miss half this information, here is why, its also the reason why I prefer using interrupts, the situation gets worse for each channel that you add because pulse in can only look at a single channel at a time meaning that you are forced to ignore any other information in the signal.

// wait for channelĀ  0
pulseLength = constrain(pulseIn(inputPinA, HIGH), 1000, 3000);
// do something time consuming guaranteeing that we miss channel 1
analogWrite(outputPinA, map(pulseLength, 1000, 3000, 0, 255));

// now wait for channel1, channel 0 will come and go without us seeing it because now we aren't even looking for it 
pulseLength = constrain(pulseIn(inputPinB, HIGH), 1000, 3000);
// do something time consuming to guarantee that we miss channel 0
analogWrite(outputPinB, map(pulseLength, 1000, 3000, 0, 255));

// and repeat

Duane B

rcarduino.blogspot.com