Section 4: Flight-Control-Functions.

............ GPS-Function Source Code .............

========= File-Name: 13_Get_GPS_Data.ino ===========


//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// ***************** Function to get GPS-Data **************** 
// ***************** Function to get GPS-Data **************** 
//                    Last Update: 1-10-22
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

// When called, this function reads NumChars GPS-Data and stores these 
// data in the char-array GPS_Data_Buffer.
// ==========================================================
void Read_GPSdata(char* GPS_Data_Buffer, int NumChars)
  {  
//Check for data from GPS sensor serial output at serial ports RX4 and TX4
    nCount=0;

       if (Serial4.available() > 0)           
         {
          Serial4.setTimeout(50);
          //Read the data string NumChars is set to 128
          nCount = Serial4.readBytes(GPS_Data_Buffer, NumChars);
         }

      //Terminate the data string
      GPS_Data_Buffer[nCount] = '\0';
      
//    Output the received data string to the serial monitor
//    Serial.println();          
//    Serial.println(GPS_Data_Buffer);
//    Serial.print("13 nCount= "); 
//    Serial.println(nCount);    
  }

//=============================================================
//+++++++++++++ End function to get GPS-Data ++++++++++++++++++
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Free-Drones Company 2022