   static unsigned long prevMicros = 0;
   static boolean lastState = LOW;
 
-  if(lastState == LOW && currentState == HIGH){ // Rising edge
+  if(lastState == LOW && currentState == HIGH){      // Rising edge
     prevMicros = currentMicros;
     lastState = currentState;
   }

void setup()
{
  // SPI slave mode
  pinMode(10, INPUT);  // CS Pin
  pinMode(12, OUTPUT); // MISO pin, this is for ATMEGA328/168
  SPCR |= _BV(SPE);// turn on SPI in slave mode
  SPCR |= _BV(SPIE); // turn on interrupts


    if(vol > curVolume) curVolume = vol;
    else {
      curVolume -= (curVolume/10);
      if(curVolume < VOL_MIN) curVolume = VOL_MIN;
    }

