Skip to content

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

@BigTwoProduction

Description

@BigTwoProduction

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions