Hi,
I am having an issue with my Arduino/Matlab serial communication. I am using a sensor on an Arduino rover and getting a ping back. The ping will send right away, then Matlab continues to look for characters until a time out error occurs. The exact error isWarning: Unsuccessful read: A timeout occurred before the Terminator was reached. I think that the issue is that I am not sending a null value to tell Matlab to stop looking for more characters after the ping comes in. From my understanding that should just be putting a serial.print('\0'), serial.print('\n'), or serial.print('\r') to mark the end of the string. I currently have Serial.print('\0') in my code. Below are my codes for both Matlab and Arduino. If anyone could please give me some guidance on which one to use or if there is a different way of doing this so Matlab will stop looking for numbers after the initial ping comes in.
Any help/advice would be greatly appreciated!
test.ino (1.84 KB)
drDaiavoidance.m (1.45 KB)