Closed nseidle closed 7 years ago
Yes, my pleasure. Thanks for your interest and enhancements, and, you know ... Sparkfun.
I commented in the merge about either exposing the delay as a defaulted parameter or doing polling as you suggest, but for the time being, the 2ms delay seems fine.
SparkFun = no problem :) Thanks!
Passing delay by argument with default is a good solution. I'll try to do that the next time I'm in the lib.
Hi Tedy - thanks for writing this lib.
I think I've found a bug:
During a .begin, a reset() is issued. Immediately after, setGain() is issued. setGain fails ~80% of the time (returns 255) because the lib immediately tries to read the first memory location
and it can't because the IC is still resetting. This causes the .begin to return 255 (error).
POR is 1.6ms max. Software reset time limit is not specified. We could poll register until it reads correctly, but I did a bit of a hack in the reset() function:
This works well for me. I'll try to issue a pull request in a moment.