Array?

Good evening Will,

Ok, I think that I start to understand your problem.

It's too late for me to respond ZZzzz ! :slight_smile:

But I have a question: do you have to read the two sensors simultaneously? Some 10's milliseconds between the read of the two sensors could be acceptable for your project?

At the first read,

  • I think that an array doesn't change anything ;
  • your code could have some problems if B sensor take a pulse before the A sensor ;
  • using external interrupt could be a best solution for you ;
  • you can reduce your code and optimize it by replacing :
    int aultraSoundSignal = 6; // US 1
    int bultraSoundSignal = 7; // US 2
    by
    #define aultraSoundSignal 6
    #define bultraSoundSignal 7
    note that there no ; at the end of the line.

I'll take a break tomorow to make a new post about this.

Please excuse my poor english.

Best regards,
Benoît ROUSSEAU