 // URL http://www.radiation-watch.org/
 //////////////////////////////////////////////////
 
-const double alpha=53.032; // cpm = uSv x alpha
-
-int index=0; //Number of loops
-char msg[256]=""; //Message buffer for serial output
-
-int signCount=0;  //Counter for Radiation Pulse
-int noiseCount=0;  //Counter for Noise Pulse
-
-int sON=0;//Lock flag for Radiation Pulse
-int nON=0;//Lock flag for Noise Puls
-
-double cpm = 0; //Count rate [cpm] of current
-int cpmIndex=0;//Position of current count rate on cpmHistory[]
-int cpmIndexPrev=0;//Flag to prevent duplicative counting
-
-//Timing Settings for Loop Interval
-int currTime=0; 
-
-int totalSec=0; //Elapsed time of measurement [sec]
-int totalHour=0; //Elapsed time of measurement [hour]
-
-//Time settings for CPM calcuaration
-int cpmTimeMSec=0;
-int cpmTimeSec=0;
-int cpmTimeMin=0;
-
-//String buffers of float values for serial output
-char cpmBuff[20];
-char uSvBuff[20];
-char uSvdBuff[20];
-
 class RadiationWatch
 {
   public:

    int signPin();
    int noisePin();
  
    static const unsigned int kHistoryCount = 200;

    double _cpmHistory[kHistoryCount]; //History of count rates
    
    int _prevTime;

  private:
    int _signPin;   //Radiation Pulse (Yellow)
    int _noisePin;  //Vibration Noise Pulse (White)
    
  
};

RadiationWatch::RadiationWatch(int signPin, int noisePin) : _signPin(signPin), _noisePin(noisePin)
{
  _prevTime = 0;
}

void RadiationWatch::setup()

    }
    
    //Initialization for next 10000 loops
    _prevTime = currTime;
    signCount=0;
    noiseCount=0;
  }
  index++;
}

RadiationWatch radiationWatch(2, 5);

void setup()
{
  //Serial setup
  //9600bps
  Serial.begin(9600);
  
  radiationWatch.setup();

  radiationWatch.printKey();
}

void loop()
{
  radiationWatch.loop();
}


