Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/arduino/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Gps 如何在Ardruino Micro上同时使用软件串行和硬件串行_Gps_Arduino - Fatal编程技术网

Gps 如何在Ardruino Micro上同时使用软件串行和硬件串行

Gps 如何在Ardruino Micro上同时使用软件串行和硬件串行,gps,arduino,Gps,Arduino,我正在尝试从两个GPS模块读取数据。一个连接到软件串行,一个连接到硬件串行。我只从硬件串口获取数据 见代码: 我们正在使用Adafruit GPS库中的leo_解析示例 你们当中有人有过这样的经验吗? 提前感谢您的帮助。如果您想使用软件串行,您需要注释掉硬件串行代码: // If using software serial, keep these lines enabled // (you can change the pin numbers to match your wiring): S

我正在尝试从两个GPS模块读取数据。一个连接到软件串行,一个连接到硬件串行。我只从硬件串口获取数据

见代码:

我们正在使用Adafruit GPS库中的leo_解析示例

你们当中有人有过这样的经验吗?
提前感谢您的帮助。

如果您想使用软件串行,您需要注释掉硬件串行代码:

// If using software serial, keep these lines enabled
// (you can change the pin numbers to match your wiring):
SoftwareSerial camSerial(8, 7);
Adafruit_GPS GPS_CAM(&camSerial);

// If using hardware serial, comment
// out the above two lines and enable these two lines instead:
// **if using software serial, comment out these next two lines**
//Adafruit_GPS GPS_PERSON(&Serial1);
//HardwareSerial personSerial = Serial1;

你介意发布一些关于你尝试过的代码吗?大概你想知道的是为什么你没有从软件序列中获取数据?是的,这就是我想知道的,你可以在这里找到代码