   } 
 }
 
+//Is there a pending encoder spin to react to? If so, which direction?
+void wasRotaryEncoderSpun() {
+  // change freq dependent on rotary encoder spin direction
+  if(spinDirection != 0) {
+    if (spinDirection == 1) {
+      freq=constrain(freq-freqDelta,bandStart,bandEnd);
+    } else {
+      freq=constrain(freq+freqDelta,bandStart,bandEnd);
+    }
+    spinDirection = 0;
+    display_frequency(freq); // push the frequency to LCD display
+    send_frequency(freq);  // set the DDS to the new frequency  
+  }
+}
+
+// Check for the click of the rotary encoder 
+void wasRotaryEncoderClicked() {
+  static long lastClick = 0;
+  
+  if (!digitalRead(RotEncSwPin) && millis() - lastClick > 200) { // push button debounce
+    // if user clicks rotary encoder, change the size of the increment
+    if (freqDelta == 10) {
+      freqDelta = 1000000;
+    } else {
+      freqDelta /= 10;
+    }
+    lastClick = millis();
+  }
+}
+
+// Light warning LED for output above a specified level
+// set conservatively to warn before distortion from amp
+// kicks in. 
+
 void checkOutputLevel() {
   static long lastTrigger = 0;
   

  }
    
 // start on M1 freq
  EEPROM.get(eeAddressStart,freq);
  if(freq < bandStart || freq > bandEnd) {
    freq = bandInit;
    EEPROM.put(eeAddressStart,freq);
  }
  
 // start up the DDS... 


void loop() {
  
  wasRotaryEncoderSpun();
  wasRotaryEncoderClicked();
  blinkCursor();
  handleMemoryButtons();
  checkOutputLevel();
  wipeStaleStatus();
  
}
