小编mab*_*bnz的帖子

Arduino - 乱码串行输出

我已经将ADH8066(Sparkfun)GSM模块连接到我的Arduino Uno,我正试图在Arduino和GSM模块之间进行正确的串行连接.当我直接(通过USB或只是TTL线)连接它时它工作正常,但是当通过Arduino控制时却没有.一些文本将正确输出,其余文本将出现乱码,几乎就像波特率错误一样,但我只是使用与从PC连接时相同的波特率(115200).

这是我正在使用的Arduino代码:

#include <SoftwareSerial.h>

#define rxPin 7
#define txPin 8
SoftwareSerial mySerial = SoftwareSerial(rxPin, txPin);

// EN: String buffer for the GPRS shield message
String SmsStorePos = String("");
String msg = String("");
String snTmp = String("");
String snFull = String("");

// EN: Set to 1 when the next GPRS shield message will contains the SMS message
int SmsContentFlag = 0;

// EN: Pin of the LED to turn ON and OFF depending on the received message
int ledPin = …
Run Code Online (Sandbox Code Playgroud)

serial-port arduino

15
推荐指数
2
解决办法
3万
查看次数

标签 统计

arduino ×1

serial-port ×1