Skip to main content
2 of 3
added 189 characters in body
gre_gor
  • 1.7k
  • 4
  • 18
  • 30

Your slave is sending an array of characters and your master is reading the ASCII values of those characters.

If you send 25.43, Serial.println will send 7 characters 2, 5, ., 4, 3, carriage return and a newline.

The master will read them as 50, 53, 46, 52, 51, 13 and 10.

On your master, you should replace

tempC = Serial.read();

with

tempC = Serial.parseFloat();
Serial.read(); // remove carriage return character from the serial buffer
Serial.read(); // remove newline character from the serial buffer
gre_gor
  • 1.7k
  • 4
  • 18
  • 30