我一直在waspmotes上使用GPS模塊,並且我已經能夠從中獲取數據。然而在一個晴朗的日子裏,天空晴朗(我認爲不重要),我無法啓動電源模式。GPS模塊停止工作,無法將模式設置爲on
在調用GPS.setMode(GPS_ON)
,也沒有設定電源模式,對後續調用凍結到:gpsConnected = GPS.check();
我已經嘗試了GPS單元改變無濟於事。我正在使用下面的代碼。 (注意:爲簡潔起見,我刪除了不必要的代碼位)
void setup()
{
ACC.ON();
USB.begin(); // Opening UART to show messages using 'Serial Monitor'
//Initialize the GPS module
GPS.ON(); // Turn GPS on
GPS.setMode(GPS_ON); // set GPS on
if(!GPS.pwrMode) USB.println("Was unable to set on the GPS internal power mode."); //this message gets printed.
if(!GPS.setCommMode(GPS_NMEA_GGA)) USB.println("Was unable to set the GPS communication mode.");
// Power up the Real Time Clock(RTC), init I2C bus and read initial values
RTC.ON();
........
}
void loop(){
//declare the variables
len, i, j = 0;
char degree[4] = "", minutes[8] = "", *latitude, *longitude, *altitude;
uint8_t temperature = 0;
int8_t fileFound = 0;
double latitude_dd, longitude_dd;
byte accOk;
//check if the GPS has connected to the satellite
GPS.begin(); // open the uart
GPS.init(); // Inits the GPS module
gpsConnected = GPS.check();
........
........
}
可能發生了什麼???
任何幫助將不勝感激。