-1

I want to send 7 sensor data from Arduino uno to nodeMCU. But using serial I can send only one. How to send all 7 at the same time with time sync between the both devices.

  • as 1,2,3,4,5,6,7? – Juraj Apr 17 at 7:35
1

You send the values one by one. A serial (UART) has a buffer. So you can send multiple bytes to a device; there the bytes are stored in a buffer, until you retrieve them.

Everything regarding timing will be handled, as long as you don't send more bytes than the buffer size, before reading them from the other device.

Example

                                          Arduino Uno        nodeMCU 
                                         Your     UART     UART   Your
                                        Program  Buffer   Buffer Program
                                        ------- --------  ------ --------
Uno: Write byte                         1
Uno: UART library                                1
Uno: Write byte                         2
Uno: UART library                                1,2
UART devices (asynchronous)                      2        1
nodeMCU: Read byte(s)                            2               1
Uno: Write byte                         3
Uno: UART library                                2, 3
UART devices (asynchronous)                               2,3    
nodeMCU: Read byte(s)                                            2, 3

Above is just an example, you only read/write bytes, the communication between the buffers and over the UART line is asynchronous.

Not the answer you're looking for? Browse other questions tagged or ask your own question.