budryerson / tfluna-i2c Goto Github PK
View Code? Open in Web Editor NEWArduino library for the Benewake TFLuna LiDAR distance sensor in the I2C communication mode
Arduino library for the Benewake TFLuna LiDAR distance sensor in the I2C communication mode
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.
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.
Set_Enable
and Set_Disable
functions's definitions should be swapped.
When I wanted to turn off TF-Luna's light I had to use Set_Enable
function instead of Set_Disable
function. Same goes for the case when I wanted to turn it back on ( I had to use Set_Disable
function instead of Set_Enable
).
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:
Can you give little support how to connect please.
Many thanks in advance.
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
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
hello!
thanks for the awesome libraries for tfmini products :)
will you be releasing the uart version for tfluna as well?
thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.