 // A digital VFO using the DDS-60 card.
 //
 // The VFO will generate signals in the range 1.000000MHz to 30.000000MHz
-// with a step of 1Hz.
+// with a step ranging down to 1Hz.
 //
 // The interface will be a single rotary encoder with a built-in pushbutton.
 // The frequency display will have a 'selected' digit which can be moved left

// save VFO state to EEPROM
void save_to_eeprom(void)
{
  EEPROM.put(AddressFreq, VfoFrequency);
  EEPROM.put(AddressSelDigit, VfoSelectDigit);
  EEPROM.put(AddressContrast, LcdContrast);
}


  lcd.noCursor();
  lcd.createChar(SPACE_CHAR, sel_digits[SPACE_INDEX]);

  pinMode(mc_Brightness, OUTPUT);
  pinMode(mc_Contrast, OUTPUT);

  // get state back from EEPROM
  restore_from_eeprom();
  analogWrite(mc_Brightness, LcdBrightness);
  analogWrite(mc_Contrast, LcdContrast);

  // set up the rotary encoder
  re_setup(VfoSelectDigit);

  // show program name and version number
  banner();
  if (pop_event() == vfo_HoldClick)
  {
    LcdBrightness = DefaultLcdBrightness;
    LcdContrast = DefaultLcdContrast;
    Serial.print("Reset brightness to "); Serial.print(LcdBrightness);
    analogWrite(mc_Brightness, LcdBrightness);
    Serial.print(" and contrast to "); Serial.println(LcdContrast);
    analogWrite(mc_Contrast, LcdContrast);
  }
  
  // we sometimes see random events on powerup, flush them here
  flush_events();
  
#ifdef DEBUG
  // dump EEPROM values
  dump_eeprom();
#endif

