Multiple Ultrasonic Sensors

What do I need to change to be able to enable Sparki.h and use multiple ultrasonic sensors. Currently, I can only get the old OR the new sensor to work: When I #include Sparki.h the below code simply will not work. Can anyone tell me what I need to change in the sparki library to get both sensors to work?

Here’s the code I’m using. I have also tried this using ports 0 and 1 and the result is always the same: When I don’t #include Sparki.h, the 2nd sensor works, but when I put back Sparki.h, it doesn’t. Where is the conflict??? Thanks so much for your help!

#define trigPin2 3
#define echoPin2 2
#include <Sparki.h>
void setup()



pinMode(trigPin2, OUTPUT);

pinMode(echoPin2, INPUT);


void loop()


int duration2, distance2;

digitalWrite(trigPin2, HIGH);


digitalWrite(trigPin2, LOW);

duration2 = pulseIn(echoPin2, HIGH);

distance2 = (duration2/2) / 29.1;





I’m still stuck with my stupid question on adding multiple PING sensors. Clearly I’m not the biggest Arduino experts, but I’d love an answer of whether it’s worth trying to get this figured out? Could I add a “trunk” with an extra Arduino Uno board and use the RX/TX pins? I’d also love to be able to add more sensors in general.

It would be probably be better to use a second board - Sparki has pretty sensitive timings that use the timer that pulsein usually uses- that’s probably why it’s not working.