Hi,
I'm trying to get my Nano to communicate with an HC-12 wireless board. The only pins I have available are analog pins
My circuit is wired as below:
A7 --> RX (HC-12)
A6 --> TX (HC-12)
A2 --> Set (HC-12)
Code is:
#include <SoftwareSerial.h>
SoftwareSerial mySerial(A7, A6); //RX, TX
void setup()
{
// Serial comms
Serial.begin(9600);
mySerial.begin(9600);
// HC-12 set pin
pinMode(A2,OUTPUT);
}
void loop()
{
if (mySerial.available())
{
Serial.print("HC12.available()");
}
while (mySerial.available())
{
Serial.write(mySerial.read());
}
digitalWrite(A2, LOW);
while (Serial.available())
{
mySerial.write(Serial.read());
}
digitalWrite(A2, LOW);
}
I'm trying to see the "AT-RX" settings and test general comms between the Nano and the HC-12. Where am I going wrong?
Thanks in advance.