You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I am attempting to setup a TFMini-Plus to run using the I2C protocol but have so far been unsuccessful in getting it to switch from UART to I2C (Note: The sensor works fine in serial mode). My motivation to switch to I2C is that I plan to run 8 of these simultaneously on a Mega board. My setup is as follows:
Arduino Mego 2560 board
Logic Level Converter to get 3.3V to the SDA and SCL ports of the TFMiniPlus
I have attempted a few different things, but my goal would be to switch these sensors using the Arduino Mega itself as I run on a mac and cannot use the provided GUI from Benewake. Most recently I have tried sending the SET_I2C_MODE with the sendCommand function. This returns as a fail in my script. My script is attached below. I am happy to provide more details or try other things out.
Thank you for all your time and any assistance you may be able to give me!
#include <Wire.h>
#include <TFMPI2C.h>
TFMPI2C tfmP;
void set_i2c_mode()
{
if( tfmP.sendCommand( SET_I2C_MODE, 0 ))
{
// If successful, display the version number...
Serial.print( "Complete"); // and brreak out of loop.
}
else
{
// If not successful, display the attempt number
// and the error: HEADER, CHERCKSUM, SERIAL, tec.
Serial.print( "failed. "); // Display error message...
}
delay(100);
}
void setup() {
// put your setup code here, to run once:
Serial.begin( 115200); // Initialize terminal serial port
delay(20);
Serial.flush(); // Flush serial write buffer
while( Serial.available())Serial.read(); // flush serial read buffer
Serial.println();
Serial.println( "*****************************");
Serial.println( "Issue command to switch to I2C");
set_i2c_mode();
}
void loop() {}
Additionally, I have also tried your provided example scripts. Here is the output I receive from the TMFPI2C_example.ino case. I can also run my script that does serial operations without issue after attempting any of these I2C scripts. Based on my understanding, if I ever successfully switch the sensor to I2C mode I should not be able to use the UART mode.
Hi, I am attempting to setup a TFMini-Plus to run using the I2C protocol but have so far been unsuccessful in getting it to switch from UART to I2C (Note: The sensor works fine in serial mode). My motivation to switch to I2C is that I plan to run 8 of these simultaneously on a Mega board. My setup is as follows:
I have attempted a few different things, but my goal would be to switch these sensors using the Arduino Mega itself as I run on a mac and cannot use the provided GUI from Benewake. Most recently I have tried sending the
SET_I2C_MODE
with thesendCommand
function. This returns as afail
in my script. My script is attached below. I am happy to provide more details or try other things out.Thank you for all your time and any assistance you may be able to give me!
Additionally, I have also tried your provided example scripts. Here is the output I receive from the
TMFPI2C_example.ino
case. I can also run my script that does serial operations without issue after attempting any of these I2C scripts. Based on my understanding, if I ever successfully switch the sensor to I2C mode I should not be able to use the UART mode.The text was updated successfully, but these errors were encountered: