1+
2+ [ ![ Arduino CI] ( https://github.com/RobTillaart/AsyncAnalog/workflows/Arduino%20CI/badge.svg )] ( https://github.com/marketplace/actions/arduino_ci )
3+ [ ![ License: MIT] ( https://img.shields.io/badge/license-MIT-green.svg )] ( https://github.com/RobTillaart/AsyncAnalog/blob/master/LICENSE )
4+ [ ![ GitHub release] ( https://img.shields.io/github/release/RobTillaart/AsyncAnalog.svg?maxAge=3600 )] ( https://github.com/RobTillaart/AsyncAnalog/releases )
5+
16# AsyncAnalog
27
38Arduino Library for async reading of an analog pin. ** \[ AVR ONLY\] **
@@ -8,23 +13,30 @@ AsyncAnalog is a library to read the analog port in an asynchronous way.
813This means that the user must explicitly ** start** the ADC, check if it is ** ready**
914and read out its ** value** .
1015
11- By using this class, the user prevents the (112 uSec) blocking of the
16+ By using this class, the user prevents the (~ 112 uSec) blocking of the
1217** analogRead()** call, and gives the user the ability to do some processing.
1318
1419The library works only for AVR boards now, other platforms might be supported in the future.
1520
1621As the UNO has only one ADC that is multiplexed, one can only read one analog pin
1722in async way simultaneously.
1823
19- ## Operation
24+ ## Interface
25+
26+ - ** AsyncAnalog(uint8_t pin)** constructor, defines the analog pin to use.
27+
2028The library consists of three main function:
2129
22- * ** void start()**
23- * ** bool ready()**
24- * ** int value()**
30+ - ** void start()** triggers a new ADC reading.
31+ - ** bool ready()** returns true if sample is complete
32+ - ** int value()** returns the value
33+
34+ ## Operation
2535
2636The example ** asyncAnalogTest2.ino** shows a loop of 1000 analogReads and prints
2737over Serial at 115200 baud. The async test does this in less time. Note that faster
28- baudrates shows an even bigger difference.
38+ baudrates shows an even bigger difference.
39+
40+ During the printing, the sampling continues.
2941
3042
0 commit comments