Hey community,
I have the wires of a Benewake TF-Luna sensor soldered to a Wemos D1-Mini.
The connections are the following:
Pin 1 (red) -----> 5V
Pin 2 (black) ---> D2 (SDA)
Pin 3 (yellow) --> D1 (SCL)
Pin 4 (white) ---> GND
Pin 5 (green) ---> D4
Pin 6 (blue) ----> unused
Here are specs of the TF-Luna:
I use this library to communicate via I2C:
When I try to run its contained TFLI2C_simple.ino example with the D1-Mini connected to my Mac, I get no signal in the serial monitor but the error message.
/* 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);
}
I will use the D1-Mini in a WiFi Network to send OSC Data to SuperCollider. So I was able to also try it with a 5 V power supply and modified WiFi/OSC code. Still no signal but the error message.
I also unsuccessfully tried it with another TF-Luna which is soldered in the same way to a D1-Mini.
It is kind of strange because I used the same setup ~1 year ago and at that time everything worked out...
What possibilty could I miss?
Thank you for your answers!