 #include <Average.h>
 #include <Ultrasonic.h>
 #include <IRremote.h>
+
 IRsend irsend;
 
 Ultrasonic ultraleft(5,6,30000);   // (Trig PIN,Echo PIN)

  pinMode(2, OUTPUT); // GND for IR
  digitalWrite(2, LOW);
  
}

long check_distance() {

  Serial.println(int(ave.stddev()));

  if ( ( ave.stddev() < 10) && ( int(ave.mean()) <= 60 )  && ( power_status == 1) ) {
    Serial.println("to blank ch");
    tv_input_to_blank();
    delay(50);
    power_status = 0;
  }

  if ( ( ave.stddev() < 10) && ( int(ave.mean()) > 100 )  && ( power_status == 0) ) {
    Serial.println("to cur ch");
    tv_input_to_cur();
    delay(50);
    power_status = 1;
  }
