jose_Quad wrote:when I try to save, this window appears
MiniGPS v1.4 also could not flush settings ((
So I have prepared GPS initialization from sketch:
1. to Serial.ino add this new function:
Code: Select all
void SerialPrint(uint8_t port, String str){
uint8_t i = 0;
while (i <= (str.length()-1)) {
SerialWrite(port, (uint8_t)str.charAt(i));
i++;
}
}
2. to config.h add new #define GPS_INIT_BAUD 9600
Code: Select all
#define GPS_SERIAL 2 // should be 2 for flyduino v2. It's the serial port number on arduino MEGA
#define GPS_INIT_BAUD 9600
#define GPS_BAUD 115200
3. In MultiWii.ino replace this:
Code: Select all
SerialOpen(GPS_SERIAL,GPS_BAUD);
//***************EOSBANDI quick hack to set the MTK gps to 10Hz.
//$PMTK220,100*2F<cr><lf>
SerialWrite(GPS_SERIAL,'$');
SerialWrite(GPS_SERIAL,'P');
SerialWrite(GPS_SERIAL,'M');
SerialWrite(GPS_SERIAL,'T');
SerialWrite(GPS_SERIAL,'K');
SerialWrite(GPS_SERIAL,'2');
SerialWrite(GPS_SERIAL,'2');
SerialWrite(GPS_SERIAL,'0');
SerialWrite(GPS_SERIAL,',');
SerialWrite(GPS_SERIAL,'1');
SerialWrite(GPS_SERIAL,'0');
SerialWrite(GPS_SERIAL,'0');
SerialWrite(GPS_SERIAL,'*');
SerialWrite(GPS_SERIAL,'2');
SerialWrite(GPS_SERIAL,'F');
SerialWrite(GPS_SERIAL,'\r');
SerialWrite(GPS_SERIAL,'\n');
to this:
Code: Select all
SerialOpen(GPS_SERIAL, GPS_INIT_BAUD);
// 251 PMTK_SET_NMEA_BAUDRATE
SerialPrint(GPS_SERIAL, (String)"$PMTK251," + GPS_BAUD + "*1F\r\n");
SerialEnd(GPS_SERIAL);
delay(200);
SerialOpen(GPS_SERIAL, GPS_BAUD);
// 220 PMTK_SET_NMEA_UPDATERATE
//Enable it for 10Hz mode
SerialPrint(GPS_SERIAL, "$PMTK220,100*2F\r\n");
delay(200);
// 314 PMTK_API_SET_NMEA_OUTPUT (GGA, GSA and RMC frames)
SerialPrint(GPS_SERIAL, "$PMTK314,0,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0*29\r\n");
delay(200);
// 300 PMTK_API_SET_FIX_CTL
// This parameter controls the rate of position fixing activity.
SerialPrint(GPS_SERIAL, "$PMTK300,100,0,0,0,0*2C\r\n");
Enjoy!

thx-
Alex