Hi, im currently working on a robotic quadcoptor and need a little help... I'm trying to set pot values on the controller from the arduino. I have been trying for about 3 hours now and it nothing seems to be working. I have taken off the joystick which controls the throttle and aileron. I soldered 3 wires to where the potentiometer was. But im not sure what im supposed to do with them. I know that one of the should go to an analog pin on the arduino (to simulate a pot values.) But the power and ground im not to sure about. The remote control is running off of its own 6v power supply. so i cant power the remote control's circuit off of the arduino. So i need to know where the power wire from the remote control hooks up to, and what the ground wire from the RC hooks up to.
this is the code ive been testing with:
int throttle = 5; // the pin that the throttle signal cable is connected to
int speedAmount = 0; // how high the throttle is
int increment = 1; // how much to speed up
// the setup routine runs once when you press reset:
void setup() {
Serial.begin(9600);
pinMode(throttle, OUTPUT);
}
// the loop routine runs over and over again forever:
void loop() {
// set the brightness of pin 9:
analogWrite(throttle, speedAmount);
// change the brightness for next time through the loop:
speedAmount = speedAmount + increment;
// reverse the direction of the fading at the ends of the fade:
if (speedAmount == 0 || speedAmount == 90) {
increment = -increment ;
}
Serial.println(speedAmount);
// wait for 30 milliseconds to see the dimming effect
delay(300);
}
Thanks so much
~ will