 // Firmware for the CIWS Residential Datalogger
 // Arduino IDE ver. 1.8.8
 // Utah Water Research Lab
-// Updated: 1/28/2019
+// Updated: 2/6/2019
 // Daniel Henshaw and Josh Tracy
 // Note: F("String") keeps string literals in program memory and out of RAM. Saves RAM space. Very good. Don't remove the F. I know it looks funny. But don't do it. Really. The program might crash if you do. And then you'll have dishonor on yourself, dishonor on your cow...
 

  pinMode(2, INPUT);              // Setup the Digital I/O Pins       
  pinMode(3, INPUT_PULLUP);
  pinMode(5, INPUT);

  magnetometerInit(&mag);         // Initialize Magnetometer
  

  if(State.readMag)
  {
    State.readMag = false;
    readData(&mag, &SignalState);  // Apparent Bottleneck
    bool peak = peakDetected(&SignalState);
    if(peak)
      State.pulseCount += 1;
  }
  
  // JOSH
  /*****************************************\
  * Sleep: put processor to sleep
  *        to be woken by interrupts
  * If serialOn is not set:
  *   call function Sleep();
  \*****************************************/
  if(!State.serialOn)
    enterSleep();

}

// DANIEL
