   return 100000 / num;
 }
 
+int irSensorPin = 2;
+int irLED = 3;
+
 int IR()
 {
-  int num = sonsor_reading(2);
+  int num = irRead(irSensorPin, irLED);
   return num;
 }
 

  int sensorPin = pin;
  int reading = analogRead(sensorPin);
  return reading;
}

// Helper Functions

  Serial.print(nSerial);
  Serial.print(" ");
  Serial.println(command);
  Serial.flush();
}

int sonsor_reading(int pin)
