Hi Morgan, thanks so much for your suggestions.
I need to send 10 packets per second since I’m using the measurements to determine relative position. 10 packets/s results in a more accurate system control.
As for the array bounds, I know that the max number of bytes (‘worst’ case) will be 15 (ex. in 255,255,255,255 number of bytes is 15).
This PWM value is subject to change based on the MATLAB calculations. It can be something like 100,125,80,80 where the number of bytes will then be 13, and so on.
- Is it incorrect to preallocate the character array for the worst case scenario (15)?
- Why does using a named constant change the interaction? Doesn’t the arduino know to stop reading the serial once the last byte is received in the incoming line as then nothing will be in the serial?
I observed the bluetoothserial in Tera Term. The code runs and works as intended but only AFTER I open the comport. It continues to work after the COM is closed as well. Before that, nothing is displayed in the bluetoothserial, not even the transmitData(); which leads me to believe that something is preventing the arduino from looping, at least initially.
Hopefully you can help me answer my questions, thanks again!