Benewake TF02-Pro Lidar
I need a nudge in the right direction, please. It's been a while since I've worked with the Prop.
I have a Benewake TF02-Pro Lidar (manual here) and have written some code (attached) to receive data from the Lidar one byte at a time via Full Duplex Serial and send it to to the Parallax Serial Terminal as a decimal via Full Duplex Serial.
The format of the message as described in the manual is:
What is shown in PST is:
$59 = decimal 89 so the frame header is correct. The other data looks OK and the number of bytes is correct.
Prior to shuffling incoming data through a byte array, my first step was to to try and identify the frame header. Any suggestions as to how to do this would be appreciated. I've tried:
a) Making a string equal to "89" and using STRCOMP to compare it to incoming bytes
b) Making a string equal to "89" and using STRCOMP to compare it to incoming bytes made into a string by Numbers.spin
c) Comparing 89 with incoming bytes as decimal numbers
d) Similar to the above but with hex
e) Comparing the incoming bytes to %01011001 ($59)