Closed ronangaillard closed 3 years ago
Ronan,
Your "dirty code" is not correct. Your command 0x5a, 0x06, 0x03, 0xe8, 0x03
makes no sense. The second byte, Command Length, is 0x06
but the array cmndData[5]
is only five bytes long. Please review 7.2 Command Convention in the Product Manual, p.17.
The fragment of code you sent: tfmP.sendCommand( SET_FRAME_RATE, FRAME_20, _tfmini_adress)
is setting the frame rate to 20Hz. Is that what you want?
The TFMini-Plus IR led is always on unless power is disconnected or the output is disabled. Setting the frame rate to zero does not disable the output.
Q. Do you know if this is an issue with the lib or with the TFMini Plus itself ?
A. It is most likely that the issue is neither the library nor TFMini-Plus.
Please send me your entire sketch and a sample of your output.
Thanks,
Bud Ryerson
San Francisco
Thanks for your quick answer @budryerson
Command is actually 6 bytes length because I need to send the checksum after. (I'm sending exactly the example command from the 7.2 Command Convention in the Product Manual).
The fragment of code you sent: tfmP.sendCommand( SET_FRAME_RATE, FRAME_20, _tfmini_adress) is setting the frame rate to 20Hz. Is that what you want?
Sorry my bad it's a typo, I tested with tfmP.sendCommand( SET_FRAME_RATE, FRAME_0, _tfmini_adress)
.
The TFMini-Plus IR led is always on unless power is disconnected or the output is disabled. Setting the frame rate to zero does not disable the output.
Mmmmm this is very bad for energy impact...
My bad, I really did a typo in my code and set the framerate to 20 instead of 0. And this works as expected.
(And the IR Led turns off 👍 )
Not sure why my dirty code does not work but I'll move to your library 😉
Hi,
I tried setting the framerate manually with the Arduino Wire library using the following (dirty) code 👍
But it did not work as the response I got from the TFMini Plus was always a bunch of
0
.But I know that the communication works well as I'm able to retrieve the measured distance through I2C.
So I gave a try to your library with the following code :
I did not see any error on the serial output, but I know the the framerate was not set accordingly because the TFMini is always getting new measures without triggering new ones (FRAME_0). And I'm also able to see the TFMINIPLus IR led on when the frame rate is 0Hz.
Do you know if this is an issue with the lib or with the TFMini Plus itself ?
Thank you