madewhatnow / TFmini-I2C-Python

A Python implementation to read data from the Benewake TFmini I2C LIDAR sensor
4 stars 5 forks source link

Questions on the code #7

Open HatefulRock opened 2 years ago

HatefulRock commented 2 years ago

Hey thanks a lot for the code, it helped me solve a problem I had trying to read info from my Tfmini plus. I was just wondering why is it that when you try to read the information sent by the sensor, you first write the buffer [1,2,7] and then read the information? Have a nice day

madewhatnow commented 2 years ago

Hi HatefulRock, it's part of the communication protocol. If you check the specifications doc in the repository, it gives the required commands on page 12. You tell the sensor which register (higher & lower byte of the address) and the length of the data that you want to read (by writing to it), then you actually read it. Hope that helps!

Very happy to hear that you found the code useful, it's a bit of niche sensor.

HatefulRock commented 2 years ago

Oh I see now. Thanks for the help!