Skip to content

Commit

Permalink
fix #82, minimal timeout 10 ms for RTOS
Browse files Browse the repository at this point in the history
  • Loading branch information
RobTillaart committed Oct 17, 2024
1 parent 11755d1 commit 6cbd9f9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6cbd9f9

Please sign in to comment.