Hello, thank you in advance for taking the time to read through this and try to help! I'm trying to connect an Arduino Mega to a ToF Laser Range Finder that communicate via hardware UART (Serial1). The datasheet from the manufacturer is riddled with typos and the test code that they sent me was not functional so this has been quite the struggle since I'm a bit of a noob with serial communication.
I've been attempting to write one_shot_auto and then read from reply_measurement_results. I've been able to isolate the header AA consistently with previous attempts at test programs, but never am able to capture AA 0 0 22 (register location that should be where the data should be placed after performing a measurement.) consistently. If I were able to, then it's simply a matter of grabbing the next few bytes (payload count, payload, signal quality, and check sum).
I will attach the user manual as well as the serial monitor output. Any and all suggestions are massively appreciated, I've been spinning my wheels on this for almost a week now.
The main problem I'm having is purely just getting consistent, synchronized communication between these two devices, to where I can then begin to do data manipulation to separate out the payload count, payload, signal quality, and check sum.
LRF_DataCaptureTHISTIMEFORSURE.ino (2.4 KB)
U81 Laser Distance Sensor USER MANUAL.pdf (3.1 MB)