ADC Library with Teensy 3.2

Status
Not open for further replies.

pmartin

Member
Hi,
working on Teensy 3.2
I use ADC library in order to sample A2 pin analog input.
I now use a function readADC() in loop() in order to read a single input. Every time the sample count reaches SAMPLES (2048), i process my samples.
This is not efficient and I have no control on the sample speed, because the loop() makes other things.

I'd like to use ADC library with interrupts in order to read the samples in background and process them when ready (2048 reads done).
Is it possible?
Does exists any example?

Thanks a lot in advance
Best regards
pmartin
 
Yes, the ADC library can do all that, with interrupts, with DMA...

There is a long, long thread in this forum where all functions (and flaws) of the ADC library are discussed. For a better understanding, you might just look at the source code of the library's source .h file where all classes, members and functions are listed.
In order to avoid frustration, I've adopted the following principle for me: "Never use a library before you have fully read and understood its source code and you are able to reproduce it by yourself!"
 
Thanks for the advice! :D
I gave it a try but it only shows 0 on the serial monitor now, i'll try to work on this method to see if there is any other break through
 
Status
Not open for further replies.
Back
Top