 ros::Publisher pub_range( "/ultrasound", &range_msg);
 char frameid[] = "/ultrasound";
 
-int trigPin=firstTrigPin;
-int echoPin=firstEchoPin;
+ int trigPin=firstTrigPin;
+ int echoPin=firstEchoPin;
 
 void increasepins(){
   trigPin++;

#include <ros/time.h>
#include <sensor_msgs/Range.h>

#define sensNumber 3
#define firstTrigPin 3
#define firstEchoPin 9


ros::NodeHandle  nh;

  //publish the adc value every 50 milliseconds
  //since it takes that long for the sensor to stablize
     long duration, distance;
  delayMicroseconds(2); // Added this line
  digitalWrite(trigPin, HIGH);
//  delayMicroseconds(1000); - Removed this line
  delayMicroseconds(10); // Added this line
  digitalWrite(trigPin, LOW);
  distance = pulseIn(echoPin, HIGH,100000)/ 58.2; //change timeout value, increase for more range decrease for higher sample rate 
 

    range_msg.range = distance;
