 // IR Detection function
 int irDetect(int irLedPin, int irReceiverPin, long frequency)
 {
-  tone(irLedPin, frequency, 10);              // IRLED 38 kHz for at least 1 ms
+  tone(irLedPin, frequency, 10);             // IRLED 38 kHz for at least 1 ms
   delay(1);                                  // Wait 1 ms
   int ir = digitalRead(irReceiverPin);       // IR receiver -> ir variable
   delay(1);                                  // Down time before recheck

#include "declarations.h"

void setup() {
  Serial.begin(9600);                        // Set data rate to 9600 bps

  pinMode(irRecPinLeft, INPUT);  pinMode(irLEDPinLeft, OUTPUT);   // IR LED & Receiver
  pinMode(irRecPinRight, INPUT);  pinMode(irLEDPinRight, OUTPUT);

  servoLeft.attach(13);
  servoRight.attach(12);

}

void loop() {
  float irDistLeft = irDistance(irLEDPinLeft, irRecPinLeft);         // Measure distance
  float irDistRight = irDistance(irLEDPinRight, irRecPinRight);
  digitalWrite(statusLedPinLeft, LOW);
  digitalWrite(statusLedPinRight, LOW);
  
  
  if(irDistLeft < 0.8){
      digitalWrite(statusLedPinLeft, HIGH);
    }
  
  if(irDistRight < 0.8){
       digitalWrite(statusLedPinRight, HIGH); 
    }
  
  Serial.print(irDistLeft);
  Serial.print("  ");
  Serial.println(irDistRight); 

}

