首页 > 解决方案 > Arduino Nano 33 BLE GPS

问题描述

我想用一个简单的例子来测试我的新 GPS 板(NEO-M9N):

#include <SoftwareSerial.h>
static const int RXPin = 4, TXPin = 3;
static const uint32_t GPSBaud = 9600;
// The serial connection to the GPS device
SoftwareSerial ss(RXPin, TXPin);
void setup()
{
    Serial.begin(115200);
    ss.begin(GPSBaud);
}
void loop()
{
// Output raw GPS data to the serial monitor
    while (ss.available() > 0){
        Serial.write(ss.read());
    }
}

但是,当我尝试在我的 arduino nano 33 ble 上运行它时,我收到了这个错误:

SoftwareSerial.h: No such file or directory

我需要做什么才能使用 arduino nano 33 ble 运行此代码?

标签: carduinogps

解决方案


这个论坛主题看来,SoftwareSerial.hArduino Nano 33 BLE Sense 板似乎不存在。但是在此 Github 问题之后,可以使用以下方式创建串行通信:

UART mySerial(digitalPinToPinName(4), digitalPinToPinName(3), NC, NC);

也看看这个 Github 问题


推荐阅读