@@ -17,31 +17,41 @@ Arduino Library for async reading of an analogue pin. **\[AVR ONLY\]**.
1717## Description
1818
1919AsyncAnalog is a library to read the analogue port of an ** AVR** in an asynchronous way.
20- This means that the user must explicitly ** start** the ADC, check if it is ** ready**
21- and read out its ** value** .
20+ This means that the user must explicitly ** start() ** the ADC, check if it is ** ready() **
21+ and read its ** value() ** .
2222
2323By using this class, the user prevents the (~ 112 uSec) blocking of the
2424** analogRead()** call, and gives the user the ability to do some processing.
2525
2626The library works only for AVR boards now, other platforms might be supported in the future.
27+ (PR's are welcome).
2728
2829** WARNING**
29- As the UNO has only one ADC that is multiplexed, one can only read one analogue pin
30- in async way simultaneously.
30+ As the UNO has only one ADC that is multiplexed, one can only read one analog pin
31+ in async way simultaneously. Still it offers to about 100 micros to do something!
3132
3233** Use with care**
3334
3435
36+ #### Related
37+
38+ - https://github.com/RobTillaart/AnalogPin
39+
40+
3541## Interface
3642
3743``` cpp
3844#include " AsynAnalog,h"
3945```
4046
4147- ** AsyncAnalog(uint8_t pin)** constructor, defines the analogue pin to use.
42- - ** void start()** triggers a new ADC reading.
43- - ** bool ready()** returns true if sample is complete.
44- - ** int value()** returns the value.
48+ - ** void start()** triggers a new ADC measurement.
49+ - ** bool ready()** Checks if the measurement is completed.
50+ If so the value is calculated and cached for ** value()** .
51+ As long as ready() is not called the old value will not change!
52+ - ** uint16_t value()** returns the value of the ADC from cache.
53+ So it will return the same value even if the internal ADC is used to sample
54+ another analog port.
4555
4656
4757## Operation
@@ -54,18 +64,22 @@ over Serial at 115200 baud.
5464
5565#### Must
5666
67+ - improve documentation.
68+
5769#### Should
5870
59- - improve documentation.
71+ - create examples
72+ - real world examples preferred.
73+ - multi ADC, e.g. A0..A4
74+
6075
6176#### Could
6277
6378- investigate the performance gain.
6479 - asyncAnalogTest2.ino is not a good test.
65- - create examples
66- - real world examples preferred.
6780- investigate other platforms
6881- fall back to normal analogRead for non AVR platforms ?
82+ - start would be analogRead() and it would immediately be ready and the value is cached.
6983 - better have specific code per platform.
7084
7185#### Wont
0 commit comments