multiple maxbotix LVEZ on one UNO?

That makes more sense to me now. Thanks. But unfortunately the code only works good for a stationary robot ranging a stationary target (21" x 21" box. There's a 4-5 second lag to change the led's to reflect the change in range if I move the robot closer or farther away. I changed some of your delays to delayMicroseconds and still get ok results. Still some spikes, though. I think the main problem is with the inherent limitations of the sensor. It's fairly accurate but the accuracy isn't very repeatable (precise).

void read_sonar(int trigpin, int pulsepin, int* ary, int asiz)
{
pinMode(pulsepin, INPUT);

for(int i = 0; i < arraysizeL; i++) {
digitalWrite(trigpin, HIGH);
delayMicroseconds(20);
digitalWrite(trigpin, LOW);
ary = pulseIn(pulsepin, HIGH) / 147;

  • //delay(100);*
  • }*
    }[/quote]
    *I also tried it with the baud rate set to 57600 got the same results. The data sheet for the Maxsonar says 9600 baud, but it works ok anyway. *
    The parallax ping sensor seems to be more accurate and precise, but it's footprint is so narrow that it's worthless for my robot. I might have to rethink my whole approach to my project.