我有一个串口输出的,集成姿态,卡尔曼滤波的6050,
但是arduino上面的串口只有一个
于是决定
#include <SoftwareSerial.h>
SoftwareSerial mySerial(10, 11); // RX, TX
他们来模拟一个软串口
然而
无论如何
在IDE串口助手里面也无法接收到软串口的数据
哪怕
#include <SoftwareSerial.h>
SoftwareSerial mySerial(2, 3); // RX, TX
void setup() { //打开串行通信,等待端口打开:
Serial.begin(57600);
while (!Serial) { ; // 等待串口连接。Needed for Leonardo only } Serial.println("Goodnight moon!");
// 设置串口通讯的速率
mySerial.begin(4800);
mySerial.println("Hello, world?");}
void loop() // 循环
{
if (mySerial.available())
Serial.write(mySerial.read());
if (Serial.available())
mySerial.write(Serial.read());}
这个示范程序也收不到那个Hello, world
求大神帮助!!人要疯了,,,
但是arduino上面的串口只有一个
于是决定
#include <SoftwareSerial.h>
SoftwareSerial mySerial(10, 11); // RX, TX
他们来模拟一个软串口
然而
无论如何
在IDE串口助手里面也无法接收到软串口的数据
哪怕
#include <SoftwareSerial.h>
SoftwareSerial mySerial(2, 3); // RX, TX
void setup() { //打开串行通信,等待端口打开:
Serial.begin(57600);
while (!Serial) { ; // 等待串口连接。Needed for Leonardo only } Serial.println("Goodnight moon!");
// 设置串口通讯的速率
mySerial.begin(4800);
mySerial.println("Hello, world?");}
void loop() // 循环
{
if (mySerial.available())
Serial.write(mySerial.read());
if (Serial.available())
mySerial.write(Serial.read());}
这个示范程序也收不到那个Hello, world
求大神帮助!!人要疯了,,,