Hi guys I'm just new to this forum. I just bought 2 HC-12 clones for my uav project, Im just testing those modules before final installation to the platform. In one way communication, one of the modules reading (or because one of the sending) I'm reading numbers like "84,101,115,116" instead of string type "TEST" text. But when i switch the modules between the two Arduino Unos it just works fine. I also checked that big white capacitor's voltage, one of them shows 3.33volts and the other shows 3.32volts at the end. I think my problem is not about range it's about something other. Any ideas how can i fix that? I really need that two way communication.
My codes below:
TRANSMIT
#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() {
mySerial.begin(9600);
}
void loop() {
mySerial.write("Test");
delay(1000);
}
RECEIEVER
#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);
int x;
String t;
void setup() {
mySerial.begin(9600);
Serial.begin(9600);
pinMode(13,OUTPUT);
}
void loop() {
if(mySerial.available()){
Serial.println(mySerial.read());
if (t==x){
digitalWrite(13,HIGH);
}else{digitalWrite(13,LOW);}
}}