diff --git a/CHANGELOG.md b/CHANGELOG.md index bb19cee..fc818a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [0.5.1] - 2024-10-17 -- fix #82, minimal timeout 10 ms for RTOS +- fix #82, minimal timeout 10 ms for RTOS, kudos to deKees687 - set error flag for TIMEOUT - add error codes to keywords.txt diff --git a/README.md b/README.md index d512df9..5946bf2 100644 --- a/README.md +++ b/README.md @@ -269,14 +269,22 @@ Default pin = 0 as this is convenient for the single channel devices. ADS.readADC(0); ``` -See [examples](https://github.com/RobTillaart/ADS1X15/blob/master/examples/ADS_minimum/ADS_minimum.ino). +See [examples](https://github.com/RobTillaart/ADS1X15/blob/master/examples/ADS_minimum/ADS_minimum.ino). The **readADC()** can return **ADS1X15_ERROR_TIMEOUT (-101)** which is an errorcode. This may conflict with a possible actual value of -101. Therefore the user should check with **getError()** if an error has occurred after reading the ADC. -This need to be fixed in the future, see issue #84. +```cpp + Value = ADS.readADC() + if (ADS.getError() == ADS1X15_OK) + // Use value + else + // handle error +``` + +The errorhandling within the library need to be improved, see also issue #84. ### Read the ADC in asynchronous way