Hello, I am working on a project that involves two arduino nanos communicating. I have successfully used the very same hc-12 on different projects in the past, but now i cant get it to work. I have tried to enter AT commands to factory reset it, but when i type "AT" and click send I get no response on the serial monitor on either of my two hc-12. I have connected:
5v->VCC
GND->GND
D2->TX
D3->RX
GND-> SET
// See SoftwareSerial example
// https://www.arduino.cc/en/tutorial/SoftwareSerialExample
#include <SoftwareSerial.h>;
#define RX 2 //Connect to the TX pin of the HC-12
#define TX 3 //Connect to the RX pin of the HC-12
SoftwareSerial mySerial(RX, TX);
void setup() {
Serial.begin(9600);
mySerial.begin(9600);
}
void loop() { // run over and over
if (mySerial.available()) {
Serial.write(mySerial.read());
}
if (Serial.available()) {
mySerial.write(Serial.read());
}
}