 #include "LEDButton.h"                                  // include custom library which is in the same directory as this file
                                                         // because it's a relative path, use "" LITERAL PATHNAME
 #include "karina_utility.cpp"                           // for void printfSecs(unsigned long seconds, T& t)
-#include <avr/interrupt.h>
+#include <avr/interrupt.h>                              // for interrupts
 //============================GLOBAL VARIABLES=================================//
 /* *** These variables MUST be global because they're being used by multiple
   totally separate functions--static local won't do


    What determines the frequency of each tick? The clock cycle does! While AVRs
    have a builtin system clock, whose processor speed determines its system
    clock frequency, you can use "prescalers" to change the clock speed/tick
    frequency of individual timers. Using a timer without prescalers would mean
    using the system clock speed, which is way too fast for many practical
    purposes. Prescalers effectively give individual timers slower clocks.
    These prescaled clocks will be slower than the system clock by factors of 2--
    that is, [frequency of prescaled clock = system clock frequency/pow(2, n)].
    You can select between different prescalers in the TCCRnB bit string.

    There are two Timer/Counter Control Registers, TCCRnA and TCCRnB, which

    Reference for knowledge but incorrect datasheet:
    http://www.atmel.com/Images/doc8025.pdf
    */
  // ATmega328P-PU datasheet: http://www.atmel.com/Images/doc8161.pdf

  cli();                                                // disable interrupts while setting up timers--CLear Interrupts
  TIMSK1 = (1 << OCIE1A);                               // set the OCIE1A bit in TIMSK1 to 1, Enabling OC Interrupts w/ OCR1A
  TCCR1B = (1 << WGM12);                                // enable CTC mode as specified in the datasheet
  TCCR1A = 0;                                           // MAKE SURE THAT THE SETTINGS IN THIS MODE ARE CORRECTLY SET TO 0 AS WELL

  /* Calculation of settings producing a Timer1 Output Compare Interrupt every 1s
    ATmega328P-PU clock speed = 16MHz = 16 000 000 Hz = ticks per second
    Want ISR every 1 second
    Prescalar is unitless, divides internal clock speed for smaller Timer clock speed
    highest prescalar = 1024
    16 000 000 Hz / 1024 = 15 625 Hz = 0.000064 s per tick with prescalar 1024
    1 tick = 1 increment
    (x increments + 1 tick for reset) * 0.000064 s per increment ~= 1 second per x increments with prescalar 1024
    x = 15 624 increments aka ticks with prescalar 1024
    */

  TCCR1B |= (1 << CS12) | (1 << CS10);                  // use 1024 prescalar for Timer1; OR combines both CS bits, |= appends old!
  OCR1A = 15624;                                        // Output Compare Register value that raises a flag every 1s w/ this Timer1
  sei();                                                // enable interrupts now that timers set up--SEt Interrupts

  Serial.begin(9600);
  TCNT1 = 0;                                            // set Timer/Counter 1 to 0
} // void setup()

/* While spinning, only update LCD every 1s--don't waste SRAM updating LCD before
  the time can even change
  */
ISR(TIMER1_COMPA_vect)                                  // Interrupt Service Routine that runs when OC unit 1A raises its flag
{
  currentSecs++;                                        // incremented every 1s, so its value truly reflects time since prog started
} // ISR(SIG_OUTPUT_COMPARE1A)

/////////////////////////////////////////////////////////////////////////////////
void loop()
