首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >GPS模块停止工作,无法setMode to on

GPS模块停止工作,无法setMode to on
EN

Stack Overflow用户
提问于 2012-12-10 16:04:36
回答 2查看 240关注 0票数 2

我一直在使用waspmotes上的GPS模块,并且我已经能够从其中获取数据。然而,在一个晴朗的日子,有清晰可见的天空(我认为这并不重要),我无法设置电源模式。

在调用GPS.setMode(GPS_ON)时,它无法将电源模式设置为on,并且在随后调用gpsConnected = GPS.check();时On会冻结

我试过更换GPS装置,但没有用。我正在使用下面的代码。(注:为简洁起见,我删除了不必要的代码)

代码语言:javascript
运行
复制
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();

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

可能发生了什么?

任何帮助都将不胜感激。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 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

票数 0
EN

Stack Overflow用户

发布于 2014-01-08 21:08:45

您需要进行简单的测试。首先,您要确保将TTl输入提供给Tx和rx引脚。如果你上传这个程序,它将给GPS输出string.If你正在使用的GPS模块与RS232输出串行输出,正如你所说,它不会work.IT TTl输入只

代码语言:javascript
运行
复制
void setup()
{
 Serial.begin();
}
void loop()
{

}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/13797073

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档