I planned to receive data through serial communication through TFluna.
And I tried to check the data with I2C
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);
}
From here it appears to fail with all method calls.
My environment is as follows.
I am using Arduino Mega, and Rx is connected to SDA (20) and Tx is connected to SCL (21). and cannot connect pin 5,6.
I don't think it's a power issue because I checked it in the serial.
Reference address: GitHub - budryerson/TFLuna-I2C: Arduino library for the Benewake TFLuna LiDAR distance sensor in the I2C communication mode
Result message received
15:00:04.865 -> Device Address: 16
15:00:04.865 -> System Reset: Status: I2C-WRITEGet Firmware Version: Status: I2C-WRITEGet Serial Number: Status: I2C-WRITEGet Time: Status: I2C-WRITESet Frame Rate to: Status: I2C-WRITEGet Frame Rate: Status: I2C-WRITEStatus: I2C-WRITEStatus: I2C-WRITEStatus: I2C-WRITEStatus: I2C-WRITEStatus: I2C-WRITEStatus: I2C-WRITEStatus: I2C-WRITEStatus: I2C-WRITEStatus: I2C-WRITEStatus: I2C-WRITEStatus: I2C-WRITEGet Time : 0
15:00:08.411 -> Status: I2C-WRITEStatus: I2C-WRITEStatus: I2C-WRITEStatus: I2C-WRITEStatus: I2C-WRITEStatus: I2C-WRITEStatus: I2C-WRITEStatus: I2C-WRITEStatus: I2C-WRITEStatus: I2C-WRITEStatus: I2C -WRITEGetTime: 0
One