Releases: wollewald/ADS1115_WE
Update of Readme
I added explanations to the blocking nature of the setCompareChannels() function and introduced the function setCompareChannels_nonblock().
Furthermore I changed the code for the delays when changing channels from
delayAccToRate(rate);
delayAccToRate(rate);
to
for(int i=0; i<2; i++){
delayAccToRate(rate);
}
because some people considered this to be copy/paste error.
Implemented full ADS1015 functionality
The library now also works with the ADS1015.
Non-blocking version of setComepareChannels was added
For advanced users a non-blocking version of setCompareChannels() was added. Users that apply this function need to take care themselves that a measured value from the new channel is already available.
Auto range functions did not work with negative voltages
Auto range functions did not work with negative voltages. The main issue were cases in which the raw values were -32768 (-2^15).
Smaller issue in function getResultWith Range()
result = map(rawResult, -32767, 32767, min, max);
changed to
result = map(rawResult, -32768, 32768, min, max);
since +/- range corresponds to +2^15/-2^15
Replaced #defines by constexpr
Various changes:
- Replaced #defines by constexpr
- Further "cleaning" of constructors
- Replaced C-cast by static_cast
- Replaced private by protected
Tidied the constructor
I eliminated some constructors. Users won't notice.
Ready to use on an ATtiny
I have added the option to use TinyWireM from Adafruit instead of Wire.
Fixed unwanted conversions in single shot mode / Changed Auto_Range.ino
For all settings in the conversion register the conversion register is read, the relevant bits are set to zero and then the relevant bits are set to the desired values. What I had overlooked is bit 15. When reading, a 1 means that no conversion is ongoing. When writing a 1 means in single shot mode that a conversion is triggered. Therefore all settings triggered a conversion in single shot mode.
Moreover I have simplified the Auto_Range.ino sketch. I was a bit more complicated than necessary.
Read performance increase
In the readRegister function, I have added a "false" in Wire.endTransmission() ---> Wire.endTransmission(false) before Wire.requestFrom(). This saves about 80 µs.