Grouping Sensor Data individually

Hi All,

I am currently working on a Project which receive data every 30 seconds from Slaves. There are 3 Slaves sending data to the Master Arduino. Note: I cannot change the Slave code, since I did not wrote the Slave software.

So basically, I have 3 devices that send temperature & humidity data each. My void loop/serial monitor start by showing:

  1. The unit ID
  2. How many devices are in that Unit
  3. Which Device is transmitting data
  4. Finally the data of that Device

What I want to do is to break down these data, having data for device 1 , device 2, device 3 separately. Probably storing them in array or maybe using Struc/Union to do this. However I am not sure how to proceed with this. Any suggestions ?

An example of the receiving data on the Serial Monitor is shown Below.

UNIT ID ABCD

NUMBER of Devices in UNIT 3

Which Unit is Transmitting 1

Temperature 25

Humidity 40

Which Unit is Transmitting 2

Temperature 27

Humidity 36

Which Unit is Transmitting 3

Temperature 26

Humidity 40

Any suggestions ?

Yeah. POST YOUR CODE.

There are 3 Slaves sending data to the Master Arduino.

There are many ways to implement some kind of master / slave philosophy. I've seen the words used here to describe SPI, I2C and others. What does master / slave mean to you?