i2cdevlib
i2cdevlib copied to clipboard
No longer using mpuInterrupt
In some of the example MPU6050_DMP6...ino files, you are no longer using the mpuInterrupt
var anywhere but the ISR? Is this intentional? Does that mean that the ISR is no longer providing any useful service?
Yes, if your system can ping the i2c bus regularly for the FIFO packet size, or you don't need the 10 ms sample rate, you can skip the mpuInterrupt() and save an input pin by only using i2c. This is especially useful if you only need the data every second or minute or longer, you could request dmpGetCurrentFIFOPacket() and it handles everything. What would happen is the FIFO buffer would be cleared and the next packet would be returned within 10ms this handles all issues by cleaning up the overflow error. The advantage of the ISR is that you can do anything else you want and when the pulse occurs you go get the latest packet.
Note: 2 pulses occur every cycle, one is for something else that I can't for the life of me figure out how to stop and the other pulse is real.
Note reading the FIFO packet size over the i2c bus is slow and consumes much more of your process time so using the ISR for a 10ms sample rate has huge advantages... But it is not needed anymore if the slower i2c checking delay is acceptable.
Z