T 3.6 reading two analog inputs simultaneously

Status
Not open for further replies.

Tady

Well-known member
Hello!
Is it possible to read two or more analog inputs at the same time?
I was looking around the forum and googling and I can't find anything:/
Thank you
 
Yes as mentioned the ADC library works great for this.

I have a WIP (Need to get back to it) Well monitor program, that uses 4 Analog sensors (actually current sensors), that I read. Two at a time, with none of them holding up the CPU while they do their work.
I have the 4 setup such that two are on ADC0 and two on ADC1 (T3.6).
I have code called on an Interval timer that completes the analog read of two sensors and starts the read of the other two, which will be read on next interval timer.

You start the read using something like: adc->startSingleRead(_pin, _adc_num)
You can test to see if the read is done: adc->isComplete(_adc_num)
Read in the results: adc->readSingle(_adc_num)

Again the latest stuff is up at: https://github.com/pedvide/ADC
My guess it currents the same as the version that downloads with Teensyduino
 
How fast is the read of the two ADCs. Did anyone measured the time it takes to complete the read?
 
Have you looked at the ADC library stuff? Like the forum thread that Theremingenieur linked to?

There is lots of information in the first posting. How long it takes depends on the options you choose (conversion speed, sampling speed, ...)
 
Sorry.. I looked at the library. It even has a nice example on exactley what I need:)
Thank you:)
 
Status
Not open for further replies.
Back
Top