c - 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 运行此代码?
解决方案
从这个论坛主题看来,SoftwareSerial.h
Arduino Nano 33 BLE Sense 板似乎不存在。但是在此 Github 问题之后,可以使用以下方式创建串行通信:
UART mySerial(digitalPinToPinName(4), digitalPinToPinName(3), NC, NC);
也看看这个 Github 问题。
推荐阅读
- java - 如何在 java 中使用 Stacks 和 Queue 制作闪存卡
- algorithm - 计算图中任意两个顶点的所有最短路径的数量
- php - Laravel MethodNotAllowedHttpException 没有消息 - 试图 Incert into mysql 表
- firebase - 创建 Firebase 开发环境?
- angular - Angular Google Maps (AGM) 核心加载问题
- scala - Spark:将 RDD 结果写入文件系统很慢
- lua - 通过表格前进和后退
- r - Shiny/R - 无法重命名列标题
- algorithm - 在递归算法中避免堆栈溢出的通常做法是什么?
- image - DrawFocusRect 函数