Show Posts
Pages: [1]
1  Topics / Robotics / Re: RC reciever to analog 0-5 voltage on: October 14, 2012, 05:51:22 pm
Hi people.

OK. John's code works good
the only problem is that if I move the RC transmitter stick from full right to full left I get about two seconds respond time.
anyone knows how to improve that?

the code:


const int inputPinA = 2;  // The pin connected to the RC receiver's servo output A
const int outputPinA = 3;  // Output PWM pin A
const int inputPinB = 4;  // The pin connected to the RC receiver's servo output B
const int outputPinB = 5;  // Output PWM pin B

void setup() {
    pinMode(inputPinA, INPUT);
    pinMode(inputPinB, INPUT);
}

void loop() {
    unsigned long pulseLength;

    pulseLength = constrain(pulseIn(inputPinA, HIGH), 1000, 2000);
    analogWrite(outputPinA, map(pulseLength, 1000, 2000, 0, 255));

    pulseLength = constrain(pulseIn(inputPinB, HIGH), 1000, 2000);
    analogWrite(outputPinB, map(pulseLength, 1000, 2000, 0, 255));
}


2  Topics / Robotics / RC reciever to analog 0-5 voltage on: October 10, 2012, 04:23:54 pm
Hi people

I really need your help.


I need to convert from RC reciever input to analog 0-5V output using the arduino

can someone tell me how write a code?

p.s
I know I have to connect lowpass filter to the analog output for steady Vout
Pages: [1]