GY-63_MS5611/libraries/AsyncAnalog
2023-10-17 19:46:28 +02:00
..
.github 0.1.5 AsyncAnalog + github actions 2023-02-01 13:08:25 +01:00
examples 0.1.5 AsyncAnalog 2021-12-13 19:46:42 +01:00
test 0.1.4 AsyncAnalog 2021-10-19 11:14:50 +02:00
.arduino-ci.yml 0.1.4 AsyncAnalog 2021-10-19 11:14:50 +02:00
AsyncAnalog.cpp 0.1.6 AsyncAnalog 2023-10-17 19:46:28 +02:00
AsyncAnalog.h 0.1.6 AsyncAnalog 2023-10-17 19:46:28 +02:00
CHANGELOG.md 0.1.6 AsyncAnalog 2023-10-17 19:46:28 +02:00
keywords.txt 0.1.4 AsyncAnalog 2021-10-19 11:14:50 +02:00
library.json 0.1.6 AsyncAnalog 2023-10-17 19:46:28 +02:00
library.properties 0.1.6 AsyncAnalog 2023-10-17 19:46:28 +02:00
LICENSE 0.1.5 AsyncAnalog + github actions 2023-02-01 13:08:25 +01:00
README.md 0.1.6 AsyncAnalog 2023-10-17 19:46:28 +02:00

Arduino CI Arduino-lint JSON check GitHub issues

License: MIT GitHub release PlatformIO Registry

AsyncAnalog

Arduino Library for async reading of an analogue pin. [AVR ONLY].

Description

AsyncAnalog is a library to read the analogue port of an AVR in an asynchronous way. This means that the user must explicitly start the ADC, check if it is ready and read out its value.

By using this class, the user prevents the (~112 uSec) blocking of the analogRead() call, and gives the user the ability to do some processing.

The library works only for AVR boards now, other platforms might be supported in the future.

WARNING As the UNO has only one ADC that is multiplexed, one can only read one analogue pin in async way simultaneously.

Use with care

Interface

#include "AsynAnalog,h"
  • AsyncAnalog(uint8_t pin) constructor, defines the analogue pin to use.
  • void start() triggers a new ADC reading.
  • bool ready() returns true if sample is complete.
  • int value() returns the value.

Operation

The example asyncAnalogTest2.ino shows a loop of 1000 analogReads and prints over Serial at 115200 baud.

Future

Must

Should

  • improve documentation.

Could

  • investigate the performance gain.
    • asyncAnalogTest2.ino is not a good test.
  • create examples
    • real world examples preferred.
  • investigate other platforms
  • fall back to normal analogRead for non AVR platforms ?
    • better have specific code per platform.

Wont

Support

If you appreciate my libraries, you can support the development and maintenance. Improve the quality of the libraries by providing issues and Pull Requests, or donate through PayPal or GitHub sponsors.

Thank you,