2036| 3
|
[求助] SIM7000 NB-IoT LTE GPRS 串口无法输入AT指令 |
运行程序后,串口接受信息但无法发送AT指令。是操作有问题吗 #include <DFRobot_SIM7000.h> #define PIN_TX 7 #define PIN_RX 8 SoftwareSerial mySerial(PIN_RX,PIN_TX); DFRobot_SIM7000 sim7000(&mySerial); void setup() { Serial.begin(115200); mySerial.begin(19200); Serial.println("Turn ON SIM7000......"); if(sim7000.turnON()){ //Turn ON SIM7000 Serial.println("Turn ON !"); } Serial.println("Set baud rate......"); if(sim7000.setBaudRate(19200)){ //Set baud rate from 115200 to 19200 Serial.println("Set baud rate:19200"); }else{ Serial.println("Faile to set baud rate"); while(1); } mySerial.begin(19200); Serial.println("For example, if you type AT\\r\\n, OK\\r\\n will be responsed!"); Serial.println("Enter your AT command :"); } void loop() { mySerial.listen(); while(mySerial.available()){ Serial.write(mySerial.read()); } mySerial.flush(); while(Serial.available()){ mySerial.write(Serial.read()); } delay(20); } |
© 2013-2024 Comsenz Inc. Powered by Discuz! X3.4 Licensed