Read two Analog signals and send one to a pin

Hi im on a project , i trying to set a pedals for a rc car , and i need to read the values of the potenciometers in the pedals and send it to one pin , im just trying to chose what reading i want to send , because one its for Go forward and the other one to go back.

The thing is when i connect that to the transmitter of the radio control , nothing happens.

int PR = A0;//Right pedal
int PL = A1;//Left Pedal
float valor = 0;
float valor1 = 0;
int control;
const int analogOutPin = 10;

void setup() {
// put your setup code here, to run once:


void loop() {

valor = analogRead(PL);//Pedal left
valor1 = analogRead(PR);//Pedal right


if (valor>0){
valor=map(valor, 0,684 ,0,255);
analogWrite(analogOutPin, valor);

else {
valor1=map(valor1, 0,684 ,0,255);
analogWrite(analogOutPin, valor1);


Which radio control ?

Having read the instructions for posting and edited your first post for the code correctly, where is the diagram (and clear photos) of how you are attempting to connect this to the RC transmitter?

Do you know what "analogWrite" is?

im using a " 4WD Speed Radio Remote control RC RTR 2.4 GHZ" , this controll comes with a wheel in the right side , to turn the car left or right , and with a trigger to go forward ,stop, and go back , if you press the trigger the car go forward and if yo move it up one time the car stop , at the second move to the front the car go back , so what i did is to map the values of the remote , save that mapping and i took and old racing game pedals to use it as gas an brake and also to the reverse , but the thing is that now i have to potenciometers , and the main board of the control has just one input , because the remote manege the gas and brake just with one potenciometer, so what i did in the code was to make an condition when and external value (that is also mapping one of the poteniometers), run one part of the code just to gas or brake depending , so im selecting the signal that i want and send it to an pwm pin , the things is that nothings happends

Bad news, most Arduino do not have any analog out pins. Only Due, Zero and some other more modern Arduino have analog out pins. On most Arduino, analog out is only simulated, by using pulse width modulation (PWM). This technique works ok for dimming LEDs, but it will not work for simulating the output of a potentiometer.

analogRead returns an int.

Please remember to use code tags when posting code

Basically, the only reason to use a "float" in code, is to prepare something for a human-readable decimal presentation.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.