我一直在使用waspmotes上的GPS模块,并且我已经能够从其中获取数据。然而,在一个晴朗的日子,有清晰可见的天空(我认为这并不重要),我无法设置电源模式。
在调用GPS.setMode(GPS_ON)
时,它无法将电源模式设置为on,并且在随后调用gpsConnected = GPS.check();
时On会冻结
我试过更换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();
........
........
}
可能发生了什么?
任何帮助都将不胜感激。
发布于 2012-12-13 15:10:20
这是由使用RTC.setTime函数引起的。在代码中,可以在这里看到:http://pastebin.com/RmA98MkD,在第195行,RTC.setTimeFromGPS()
上,我用从GPS接收到的时间来设置棋盘时间。这最终导致GPS连接中断,代码只循环了一次。你可以从这里看到详细的对话:http://www.libelium.com/forum/viewtopic.php?f=16&t=9861
发布于 2014-01-08 21:08:45
您需要进行简单的测试。首先,您要确保将TTl输入提供给Tx和rx引脚。如果你上传这个程序,它将给GPS输出string.If你正在使用的GPS模块与RS232输出串行输出,正如你所说,它不会work.IT TTl输入只
void setup()
{
Serial.begin();
}
void loop()
{
}
https://stackoverflow.com/questions/13797073
复制相似问题