Open brightproject opened 3 weeks ago
Hello,
HALRead without register is a work around for some specific sensors, such as the HTU21D, etc., that do not need to specify the register address to read the measurement:
if (!m_settings->HALRead(m_humidityAddr, 3, rawData, "Failed to read HTU21D temperature"))
By the way, is the I2Cdev.cpp from RTIMULib2-Teensy? you can put the source code here
Hello. Thanks for your reply. I'm used this code
https://github.com/jrowberg/i2cdevlib/tree/master/Arduino/I2Cdev
Only it copied and started working.
In general, the add-on in the form of HAL
libraries
RTIMUHal.h
RTIMUHal.cpp
is quite inconvenient, and my I2C
bus and microcontroller freeze after 5-10
seconds of operation.
I will rewrite the work with the I2C
bus as it was done in RTIMULib-Arduino
Hello @HongshiTan I'm using code from another repo written for
teensy
, and I rewrote it for Arduino and compiling it forstm32f411
.Unfortunately for me, there is no way to discuss code and stuff in this repo. In the repository
there is such a possibility, but the RTIMUHal class is a little different, or rather more functional and advanced, but the meaning is the same. I'm wondering what the case-insensitive read functionality is used for?
Actually, I had a problem with compilation when the code had such a strange reading initialization:
I2Cdev::readBytes(slaveAddr, regAddr, length, data, 10)
which I replaced with:I2Cdev::readBytes(slaveAddr, regAddr, length, data)
And also had to add a new function to the libraryI2Cdev.h
andI2Cdev.cpp
static int8_t readBytes(uint8_t devAddr, uint8_t length, uint8_t *data, uint16_t timeout=I2Cdev::readTimeout, void *wireObj=0)
; But this is not used anywhere in the code, which is why it caused strangeness. Can someone tell me what this is used for? I mean, when isregAddr
not needed? P.S. Perhaps this issue can be converted into discussions?