Hi, I suspect I have the same problem. I have the DFRobot sen0386. I bought it with the assumption that it would give me an “angle” reading and not just a rotation rate that I’d have to integrate/do a kalmen filter or other mathemagics on. It does indeed seem to give a good angle reading but only at a rate of 10Hz.
Using the stock example code and changing FREQUENCY_10HZ ro FREQUENCY_100HZ) does not seem to change the “loop frequency”.
I have confirmed that the code causing the “delay” in the loop is the example code:
if (sensor.available()) {
If you time this piece of code it takes almost exactly 100ms. If you count, say, the number of times this is executed in one second, you get the same result.
AI answers on the web say to remove Serial.prints, delays, etc. That does nothing.
AI also recommends reading the registers directly to see if the command to change the frequency is actually taking place. I’m too much of a newb to know what it’s talking about to do that. AI suggestion:
2. How to Read the Register (Command)
To verify the update, you must send a “Read Register” command to the sensor and parse the response.
Command to Read Register 0x03:
0xFF, 0xAA, 0x27, 0x03, 0x00
I have briefly and inexpertly examined the DFRobot_WT61PC library files and don’t see any “delay (100)” or other things like that, but again, I’m just a newb looking at somewhat-greek-to-me code.
This is for a balancing type project and I think it needs way better than 10Hz feedback. I have tried another IMU, BMI270, which seems to probably run fast enough to work. But then I need to do a bunch of math and kalmen filters and probably other stuff to get a realistic and reliable “angle” value, which I have not been successful with yet. Probably due to my newbness.
Would be a super big help if I could just read an angle and be done with it.
Help?