Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 7 of 7

Thread: T 3.6 reading two analog inputs simultaneously

  1. #1

    T 3.6 reading two analog inputs simultaneously

    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

  2. #2
    Senior Member+ Theremingenieur's Avatar
    Join Date
    Feb 2014
    Location
    Colmar, France
    Posts
    2,551
    It is possible. You didn't look around enough... Pedvide's ADC library allows simultaneous readings of two signals, using both integrated ADCs. More is not possible in simultaneous mode since there aren't more than 2 ADCs.
    https://forum.pjrc.com/threads/25532...ll=1#post45376

  3. #3
    Woww thank you! It seems I missed that! Thank you so much I will try it out

  4. #4
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    6,105
    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

  5. #5
    How fast is the read of the two ADCs. Did anyone measured the time it takes to complete the read?

  6. #6
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    6,105
    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, ...)

  7. #7
    Sorry.. I looked at the library. It even has a nice example on exactley what I need
    Thank you

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •