ESP32 ADC non-blocking library
Posted: Tue Feb 27, 2018 4:47 am
I created an easy library for the ESP32 arduino toolchain to read the ADC, average up to 1,000,000 samples, linearize it (because the integral non-linearity is horrible), all with non-blocking code. The pieces to make a fully functional non-blocking analogRead were already a part of the ESP32 arduino toolchain, I just put the puzzle together, added averaging, and a means to calibrate it (linearize), and packaged it.
I know there is a 30 point lookup table that is available to linearize the SAR ADC, but for my purposes a software solution was simpler
The code arbitrates the ADC in a round-robin or token fashion, so you can instantiate the library for however many GPIO pins you need as ADCs, and a Global token takes care of who gets to use the ADC
https://github.com/terryjmyers/analogReadNonBlocking
I know there is a 30 point lookup table that is available to linearize the SAR ADC, but for my purposes a software solution was simpler
The code arbitrates the ADC in a round-robin or token fashion, so you can instantiate the library for however many GPIO pins you need as ADCs, and a Global token takes care of who gets to use the ADC
https://github.com/terryjmyers/analogReadNonBlocking