Syncing serial poll with baud rate? Arduino serial communication.

Micah Livesay's icon

Hi there,

I'm building a patch that unpacks and sorts arduino sensor data in order to utilize it for generating a soundscape and I've got a question about baud and poll rates.

My current arduino sketch cycles through three sensors and then prints those measurements to the serial port at the end of each loop.

I've set the poll rate to match the timing set in the arduino sketch but they don't stay in sync.

I think my patch kinda handles that and can use the data accurately but...I was wondering if there was a way to sync the baud and poll rate so I reliably know that I am getting a new batch of measurements at the end of each arduino loop?

Thanks for your time,
Micah

Current patch is below.

231215__Triple_HC-SR04__Tests_2.maxpat
Max Patch

Source Audio's icon

I think you mix meaning of baud rate and poll rate.
baud rate is speed of transmission to - from serial port devices.
in simple words bits per second.
poll rate of serial object is interval at which it polls data from serial buffer.

If you send that many & fast data from arduino that you need 115200 baud rate, (11520 bytes per second) polling at 50ms interval makes no sense.

Arduino code can be well written in sense not to flood serial buffer with
unneeded repetitions of sensor readings, or then bad - it is a free world.