NANO DRONE EP1 : Hook up Flysky to Arduino NANO

 

FlySky FS-i6 2.4G 6CH AFHDS RC Radion Transmitter With FS-iA6B Receiver for RC FPV Drone

https://www.banggood.com/custlink/KKK3FoBbUO

Manual : https://drive.google.com/file/d/1pOiHj9m0HxIeDRs6IpjiTVY0ntMojYiw/view?usp=sharing

Wiring

Bind Remote ( Connect Transmitter and receiver )

 

 

Code for read data from Flysky receiver
int channel1 = 2; //   Pitch
int channel2 = 3;//    
int channel3 = 4; //  Throttle
int channel4 = 5;//    YAW
int SWA = 6;// SWA

int Channel1 = 0 ; // Used later to 
int Channel2 = 0 ; // store values
int Channel3 = 0 ; // Used later to 
int Channel4 = 0 ; // store values
int SWAstate = 0 ; // store values


void setup() {
  // put your setup code here, to run once:
Serial.begin(9600);
   pinMode (channel1, INPUT);// initialises the channels
   pinMode (channel2, INPUT);// as inputs
   pinMode (channel3, INPUT);// initialises the channels
   pinMode (channel4, INPUT);// as inputs
   pinMode (SWA,INPUT);// Switch A 


}

void loop() {
  // put your main code here, to run repeatedly:

   
  Channel1 = (pulseIn (channel1, HIGH)); // Checks the value of channel1
  Serial.print ("Channel1 :");
  Serial.println (Channel1); //Prints the channels value on the serial monitor

Channel2 = (pulseIn (channel2, HIGH)); // Checks the value of channel1
  Serial.print ("Channel2 :");
  Serial.println (Channel2); //Prints the channels value value on the serial monitor

Channel3 = (pulseIn (channel3, HIGH)); // Checks the value of channel1
    Serial.print ("Channel3 :");
  Serial.println (Channel3); //Prints the channels value value on the serial monitor

Channel4 = (pulseIn (channel4, HIGH)); // Checks the value of channel1
    Serial.print ("Channel4 :");
  Serial.println (Channel4); //Prints the channels value value on the serial monitor
int SWAState = (pulseIn (SWA,HIGH)); // Checks the value of channel1
    Serial.print ("SWAState :   ");
  Serial.println (SWAState); //Prints the channels value value on the serial monitor

delay(2000);
}

Leave a Reply

Your email address will not be published. Required fields are marked *