Hi! I wrote a little sketch to try out wireless communication between two Arduinos using HC12 modules, where the Master sends every 2 seconds this string: M,0,255,0,E. The slave Arduino also receives the message everytime, but for some reason, it mostly isn't 100% the same I sent, and contains weird letters.
Can anyone help me?
I don‘t want to be mean, but have you even read what I wrote? I know how Serial communication works, even tried the same code with two Arduinos connected to each other by cable, and it worked perfectly. I think that the problem has something to do with the HC12 modules.
Can you post all of the code for both sending and receiving.
Do the baud rates match?
Your receive code does not handle serial data very well. At 9600 baud, the data is coming in slowly... and the Arduino will process it faster than it arrives, so you won't always have a complete message before printing it out.