ADC ultra sound reading from two ports simultaneously

JNivard

Member
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/Teensy_4_html/class_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
 
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
 
Back
Top