2012-12-10 74 views
2

我一直在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(); 

    ........ 
    ........ 
} 

可能發生了什麼???

任何幫助將不勝感激。

回答

0

你需要簡單的測試。首先你要確保你給Tx和rx引腳提供TT1輸入。如果你上傳這個程序,它會給出GPS輸出字符串。如果你使用帶有RS 232串行輸出的GPS模塊,正如你所說它不會工作.IT期待TT1輸入只有

void setup() 
{ 
Serial.begin(); 
} 
void loop() 
{ 

}