Go Down

Topic: How to send numbers from one Arduino to another using Serial (Read 4 times) previous topic - next topic

Nick Gammon

Maybe:

Code: [Select]

long _rpm = -1;

...

    if (_rpm != -1)
      {
      Serial.println(_rpm);
      _rpm = -1;
      }



matinzk

This works beautifully thanks.

However if I have a set of extra data to also send via another serial port (Serial 3) to a device using a Bluetooth module, then I get missing data again.

So I receive the _rpm from first Arduino to my second Arduino Mega, then I send _rpm with 3 more data to Serial3 and receive these on my phone, the _rpm data is sometimes missing as before

Nick Gammon

Why are you doing it that way? Why not do the serial print in the processNumber function, which is the way that works anyway?

Quote
However if I have a set of extra data to also send via another serial port (Serial 3) to a device using a Bluetooth module, then I get missing data again.


Post this new code please.

matinzk


Go Up