 #include <IRremote.h>
 #include <Wire.h>
+#include <Average.h>
+
+Average<float> ave1(4);
+Average<float> ave2(4);
 
 /*
  Sharp Optical Dust Sensor GP2Y1010AU0F

int sleepTime = 9680;

int voMeasured = 0;
float calcVoltage = 0;
float dustDensity = 0;



void requestEvent()
{
  byte myArray[4];
  int sleepmodetosend ;

  if ( sleepmode == o_sleepmode ) {
    myArray[0] = (int(ave1.mean()) >> 8 ) & 0xFF;
    myArray[1] = int(ave1.mean()) & 0xFF;
    myArray[2] = (int(ave2.mean()) >> 8 ) & 0xFF;
    myArray[3] = int(ave2.mean()) & 0xFF;

    Wire.write(myArray, 4);
  }

  if ( sleepmode != o_sleepmode )  {
