Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to set return distance in millimetres for TF-Luna #1

Open
BigTwoProduction opened this issue Aug 3, 2022 · 0 comments
Open

How to set return distance in millimetres for TF-Luna #1

BigTwoProduction opened this issue Aug 3, 2022 · 0 comments

Comments

@BigTwoProduction
Copy link

Hello,

I started to use your work (thanks a lot by the way) in order to discover the capabilities of the TF-Luna sensor. Some modifications allowed me to communicate with the sensor in I2C. I asked myself a question, how to have the result in millimeter?

I looked at the documentation provided, I see a reference in the appendix "Appendix II Serial communication protocol" Output format setting ID_OUTPUT_FORMAT=0x05, where it is indicated different possible format

  • 0x01 = 9-byte/cm
  • 0x02 = PIX
  • 0x06 = 9-byte/mm
  • 0x07 = 32-byte with timestamp
  • 0x08 = ID-0
  • 0x09 = 8-byte/cm

Nevertheless these indications are for the serial part and not indicated in the part in appendix "Appendix III I2C register table".

Moreover I noticed in the github repository https://github.com/budryerson/TFMini-Plus_python/blob/main/tfmplus.py, for a serial type communication, the possibility to send to the sensor register values of this type.

  • I2C_FORMAT_CM = 0x01000500 # returns a 9 byte data frame
  • I2C_FORMAT_MM = 0x06000500 # "

With Github repository, https://github.com/budryerson/TFLuna-I2C_python, how can I get the distance value in millimeters from the sensor?

Thanks in advance,
Best regards,
Jordan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant