我正在尝试从 arduino+HC-12 向 NodeMcu V1.0 a2-e + HC-12 发送一个简单的消息。什么都没发生。有什么建议吗?
我的代码是:
代码:
全选#include
SoftwareSerial mySerial(7,8 ); //RX, TX
void setup() {
Serial.begin(9600);
mySerial.begin(9600);
}
void loop() {
if(Serial.available() > 0){//Read from serial monitor and send over HC-12
String input = Serial.readString();
mySerial.println(input);
}
if(mySerial.available() > 1){//Read from HC-12 and send to serial monitor
String input = mySerial.readString();
Serial.println(input);
}
delay(2000);
}