How to I convert multiple lines of serial read from the UNO to ESP32 via floats?

My project consists of a Arduino UNO hooked to a lot of 5V sensors. If I go into serial monitor via my computer I can see that all data values from the sensor is shown (in 5 seperate lines). However the Ardunio UNO does not have a wifi support or Ardunio IOT support but the ESP32 does. I hooked up the ESP32 RX and TX pins to a logic converter to the UNO's RX TX. Im thinking of using serial read for the ESP32 but I need a way to convert each line of the serial read into different float variables.

(This is the UNO's Code)
Data only Version STEM IGNITE.ino (4.5 KB)

(This is the ESP32's Code)
ESP32 IGNITE STEM.ino (1.7 KB)

see atof() function

That solves the conversion, but how do I seperate each line in serial read into individual variables

Could you show an example of input lines?

Suppose that the simplest way is separate the values on Arduino Uno before sending

6
7
200
99

(These are individual outputs from the sensors shown in serial)
I removed the text before the outputs
each output would update after 5 seconds

So each line contains only one value?
And what is your problem?

another microcontroller reads those values via RX and TX from the UNO. the problem is how do i convert those lines into individual variables

Convert each line in individual value via atof()...
I am still do not understand your problem, sorry

May be inserting the code will help.

None of those numbers would be considered of the float data type. There is no fractional part (decimal places).

We would like to see the exact structure of the message that you want to parse. Are there delimiters, are there start and end markers (CR and/or LF).

Is the serial data in binary or text?

@techie787
Please insert the code in the forum, using the code tags.
Downloading the code from external links is not in tradition of forum, read the forum guidelines.

The serial input basics tutorial has some good information.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.