GithubHelp home page GithubHelp logo

budryerson / tfluna-i2c Goto Github PK

View Code? Open in Web Editor NEW
29.0 2.0 9.0 3.8 MB

Arduino library for the Benewake TFLuna LiDAR distance sensor in the I2C communication mode

C++ 100.00%
benewake lidar tfluna tf-luna arduino arduino-library

tfluna-i2c's People

Contributors

budryerson avatar njh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

tfluna-i2c's Issues

Feature request: Make a function to get value of tfStatus

Thank you for writing this library. It works great.

However I still have the following problem. Since I access the TF-Luna via my own library in a separate file, the library has no access to the Serial device. For a larger project it can be that the Serial device remains out of scope. So if things do not go as planned, I can't do a tfli2c.Print_Status. (See project: House2 TF-Luna HAL )

Feature request:
Provide a function to get the value of tfStatus. And/Or provide a function to copy the message to a char[20] buffer.

Example not showing in Example menu.

The two example are not showing in the menu example because each example have to be in separated folder named by the ino file
Users\UserName\Documents\Arduino\libraries\TFLI2C\example\TFLI2C_simple\TFLI2C_simple.ino
instead
Users\UserName\Documents\Arduino\libraries\TFLI2C\example\TFLI2C_simple.ino

Thanks for your work on this lib.

Pin layout for Arduino UNO

Hi, thank you for providing this nice library.
I have some problems connecting the device correctly to my Arduino UNO (R3).
Serial output is always like:

Status: I2C-WRITEStatus: I2C-WRITEStatus: I2C-WRITEStatus: I2C-WRITEStatus: I2C-WRITE

I connected Luna to UNO like:

  • 1 -> 5V
  • 2 -> GPIO18/SDA
  • 3 -> GPIO19/SCL
  • 4 -> GND
  • 5 -> GND
  • 6 -> UNCONNECTED

Can you give little support how to connect please.

Many thanks in advance.

Troubleshooting TFLuna sensor

Hello—I'm using the example code "TFLI2C_simple.ino"; Arduino UNO; and a Benewake TF-Luna.

My issue is this: the only output is the setup print:

TFLI2C example code simplified
4 NOV 2021

No values coming out of the sensor. My question is this—I've got no red LED lit up on the TF-Luna; does this indicate that the sensor is broken? I'd obviously like to know whether I can skip more troubleshooting with the code and should instead just order another LIDAR sensor!

Much obliged—and thanks for providing all these helpful scripts and guides!


/* File Name: TFLI2C_simple.ino
 * Developer: Bud Ryerson
 * Date:      4 NOV 2021
 * Version:   0.1.2
 * Described: Simplified Arduino example sketch for the Benewake
 *            TF-Luna LiDAR sensor configured for the I2C interface
 */
 
#include <Arduino.h>     // every sketch needs this
#include <Wire.h>        // instantiate the Wire library
#include <TFLI2C.h>      // TFLuna-I2C Library v.0.2.0

TFLI2C tflI2C;

int16_t  tfDist;    // distance in centimeters
int16_t  tfAddr = TFL_DEF_ADR;  // use this default I2C address or
                                // set variable to your own value

void setup()
{
    Serial.begin( 115200);  // initialize serial port
    Wire.begin();           // initialize Wire library
    Serial.println( "TFLI2C example code simplified"); // say "Hello!"
    Serial.println( "4 NOV 2021");                     // and add date
}

void loop()
{
    if( tflI2C.getData( tfDist, tfAddr)) // If read okay...
    {
        Serial.print("Dist: ");
        Serial.println(tfDist);          // print the data...
    }
    else tflI2C.printStatus();           // else, print error.

    delay( 50);
}

Pins: 1 -> 5v, 2->SDA, 3-> SCL (switching these doesn't change anything), 4 -> GND, 5 -> GND

TF Luna I2C distance in MM

Hi Bud,

Thank you for your wonderful libraries! I was previously using the TFMPlus library with my TF Luna and it was working great, however I am now switching to I2C and using the tca9548A mux such that I can gather data from 4 Lunas on one board (Arduino Mega or Nano).

In the TFMPlus library, I was able to set the settings to MM and noticed there was no function for MM in the TFLuna-I2C library. Did I not look carefully enough in the .cpp / README files?

If there is no function, could you help guide me on how to switch the settings to MM? I see on the data sheet from Benewake that you can change output format using different hex inputs, but I'm not the strongest with this type of coding. Thanks in advance for any help!

Cheers,
Alec

uart version

hello!

thanks for the awesome libraries for tfmini products :)

will you be releasing the uart version for tfluna as well?

thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.