Hi.
I connect flysky FS-i6X and FSIA10B receiver with Arduino UNO R4.
I can read channel 1-6 but I cannot read data from channel 7-10
This is my code.
int ch1;
int ch2;
int ch3;
int ch4;
int ch5;
int ch6;
int ch7;
int ch8;
int ch9;
int ch10;
int speedA;
int speedB;
int m11=2, m12=3,m21=4,m22=7, speedPinA = 6, speedPinB = 5;
void setup() {
pinMode(8, INPUT);
pinMode(9, INPUT);
pinMode(10, INPUT);
pinMode(11, INPUT);
pinMode(12, INPUT);
pinMode(13, INPUT);
pinMode(2, INPUT);
pinMode(3, INPUT);
pinMode(4, INPUT);
pinMode(5, INPUT);
Serial.begin(9600);
pinMode(m11,OUTPUT);
pinMode(m12,OUTPUT);
pinMode(m21,OUTPUT);
pinMode(m22,OUTPUT);
pinMode(speedPinA,OUTPUT);
pinMode(speedPinB,OUTPUT);
digitalWrite(m11, LOW);
digitalWrite(m12, LOW);
digitalWrite(m21, LOW);
digitalWrite(m22, LOW);
}
void loop() {
ch1 = pulseIn(8, HIGH, 25000); // อ่านค่าความกว้างของสัญญาณของแต่ละ Channel
ch2 = pulseIn(9, HIGH, 25000);
ch3 = pulseIn(10, HIGH, 25000);
ch4 = pulseIn(11, HIGH, 25000);
ch5 = pulseIn(12, HIGH, 25000);
ch6 = pulseIn(13, HIGH, 25000);
ch7 = pulseIn(2, HIGH, 25000);
ch8 = pulseIn(3, HIGH, 25000);
ch9 = pulseIn(4, HIGH, 25000);
ch10 = pulseIn(5, HIGH, 25000);
Serial.print("Channel 1:");
Serial.println(ch1);
Serial.print("Channel 2:");
Serial.println(ch2);
Serial.print("Channel 3:");
Serial.println(ch3);
Serial.print("Channel 4:");
Serial.println(ch4);
Serial.print("Channel 5:");
Serial.println(ch5);
Serial.print("Channel 6:");
Serial.println(ch6);
Serial.print("Channel 7:");
Serial.println(ch7);
Serial.print("Channel 8:");
Serial.println(ch8);
Serial.print("Channel 9:");
Serial.println(ch9);
Serial.print("Channel 10:");
Serial.println(ch10);
Serial.println("");
}