Arduino does not serial print reciever value

I am trying to get a simple sparkfun sketch to work on an arduino mega, I can get ch1 to give value but channel's 2 and 3 only give 0. I am using a standard rc reciecver (fs-i6) what could be cuasing this error?


int ch1; // Here's where we'll keep our channel values
int ch2;
int ch3;

void setup() {

  pinMode(A0, INPUT); // Set our input pins as such
  pinMode(A1, INPUT);
  pinMode(A2, INPUT);

  Serial.begin(9600); // Pour a bowl of Serial

}

void loop() {

  ch1 = pulseIn(A0, HIGH, 25000); // Read the pulse width of 
  ch2 = pulseIn(A1, HIGH, 25000); // each channel
  ch3 = pulseIn(A2, HIGH, 25000);

  Serial.print("Channel 1:"); // Print the value of 
  Serial.println(ch1);        // each channel

  Serial.print("Channel 2:");
  Serial.println(ch2);

  Serial.print("Channel 3:");
  Serial.println(ch3);

  delay(1000); // I put this here just to make the terminal 
              // window happier
}

@TORTLE_TECH, your topic has been moved to a more suitable location on the forum.

Try using other pins on the mega. You don't need to use analog pins for pulseIn(). Try using A0 for channels 2 and 3, because you know A0 works ok. Also try altering the order in which the sketch reads the 3 channels. If you still get zero for channels 2 & 3 whichever Arduino pins you use and whichever order you read them in, I would suggest there is nothing wrong with your mega or your sketch.

I have found that pin 51 is able to read the second channel but when both channel 1 and 2 and plugged in, channel 1 always gets read and channel 2 gives 0 unless 1 is unplugged.

Did you try changing the order in which the channels are read, as I suggested?

yes, even when i move channel 2 to the top, channel 1 is still the only channel read

But you are saying if you unplug channel 1, you can then read channel 2?

Can you post a link to the specs of the receiver, a schematic showing how you wired this to the mega, and some bright, clear pictures of the circuit showing how each wire is connected.