本文整理汇总了C++中Adafruit_GPS::init方法的典型用法代码示例。如果您正苦于以下问题:C++ Adafruit_GPS::init方法的具体用法?C++ Adafruit_GPS::init怎么用?C++ Adafruit_GPS::init使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Adafruit_GPS
的用法示例。
在下文中一共展示了Adafruit_GPS::init方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setupGPS
void Communicator::setupGPS() {
// Initialize the variables in GPS class object
GPS.init();
// Start the serial communication
GPS_SERIAL.begin(GPS_BAUD);
// Commands to configure GPS:
GPS_SERIAL.println(PMTK_SET_NMEA_OUTPUT_RMCONLY); // Set to only output GPRMC (has all the info we need),
GPS_SERIAL.println(SET_NMEA_UPDATE_RATE_5HZ); // Increase rate strings sent over serial
GPS_SERIAL.println(PMTK_API_SET_FIX_CTL_5HZ); // Increase rate GPS 'connects' and syncs with satellites
GPS_SERIAL.println(ENABLE_SBAB_SATELLITES); // Enable using a more accurate type of satellite
GPS_SERIAL.println(ENABLE_USING_WAAS_WITH_SBSB_SATS); // Enable the above satellites in 'fix' mode (I think)
delay(3000); //Not really sure if needed.
// Flush the GPS input (still unsure if the GPS sends response to the above commands)
while (GPS_SERIAL.available()) {
//GPS_SERIAL.read();
DEBUG_PRINT("FLUSH RESPONSE: ");
DEBUG_PRINT(GPS_SERIAL.read());
DEBUG_PRINTLN("");
}
DEBUG_PRINTLN("DONE FLUSHING");
}