I would be glad to know in what way the sketch of post #7 is fragile. This will help me to improve my sketch.
Don't know if anyone cares, but here is the code I run on the Mega to see if the Pro Micro is transmitting.
/* sketch for Mega to receive serial data via HC-12 module
HC-12 wired to Mega board as follows:
VCC to VCC
GND to GND
RX to TX1 (pin 18)
TX to RX1 (pin 19)
SET to pin 10
*/
const byte ATModePin = 10; //wired to SET pin of HC12
int receivedData;
void HC12_Channel_005() // Set the HC12 to channel 05
{
digitalWrite(ATModePin,LOW); //puts the HC12 into AT Command Mode
Serial.println("HC-12 in command mode");
delay(50);
Serial1.write("AT+DEFAULT");
delay(500);
while(Serial1.available())
{Serial.write(Serial1.read());} //prints response from HC-12
delay(50);
Serial1.write("AT+C005");
delay(500);
while(Serial1.available())
{Serial.write(Serial1.read());} //prints response from HC-12
delay(50);
digitalWrite(ATModePin,HIGH); //puts HC12 back into regular mode
Serial.println("HC-12 back in regular mode");
delay(1000);
}
void setup()
{
pinMode(ATModePin, OUTPUT);
Serial.begin(9600);
Serial.println("\nSerial monitor begin");
Serial1.begin(9600);
Serial.println("Serial1 begin");
HC12_Channel_005();
delay(100);
}
void loop()
{
if (Serial1.available())
{
receivedData=Serial1.read();
Serial.print(receivedData);
Serial.print(" ");
}
}