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

Thread: ADC ultra sound reading from two ports simultaneously

  1. #1
    Junior Member
    Join Date
    Jan 2020
    Posts
    9

    ADC ultra sound reading from two ports simultaneously

    Hai

    I am building a ultrasound device using an two analogous mems microphone circa 85 KHz. The analogous part contains two microphones and a distance of 1 or more meter between them. I like to do simultaneous readings from the analogues input channels and calculate the direction and distance of the ultra sound source.

    According some specification I can do a simultaneous read (teensy 4) AN INTRODUCTION TO MICROCONTROLLERS AND
    EMBEDDED SYSTEMS page 65 (analogSynchronizedRead(pin1, pin2) Also in other documents I find this option (http://pedvide.github.io/ADC/docs/Te...ass_a_d_c.html). Because timing is critical I like to use this option!

    When I try this line in my basic coding I receive a compiling error "analogSyncRead"was not declared.


    How can I use the simultaneously reading of two ports on a teensy 4

    I am not so experienced and I think I mix up C options and arduino options but I do'nt know

    Some help needed

  2. #2
    Senior Member
    Join Date
    Nov 2012
    Posts
    1,688
    Post your code (preferably in code tags - the # icon)
    You need to instantiate an ADC object:
    Code:
    ADC *adc = new ADC(); // adc object
    and then refer to it as:
    Code:
      ADC::Sync_result sr = adc->analogSyncRead(A0,A1);
    Pete

Posting Permissions

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