   sei();    // turn interrupts back on
 }
 
+void playDit() {
+  now = millis();
+  if (now > interToneLockTimer) {
+    tone(speakerPin, sideToneFreq, ditLength);
+  }
+  interToneLockTimer = millis() + interToneLength;
+  last = dit;
+}
+
+void playDah() {
+  now = millis();
+  if (now > interToneLockTimer) {
+    tone(speakerPin, sideToneFreq, dahLength);
+  }
+  interToneLockTimer = millis() + interToneLength;
+  last = dah;
+}
+
+void play(sym) {
+  if (sym) {
+    playDit();
+  } else {
+    playDah();
+  } 
+}
+
+void diDah() {
+  if (digitalRead(ditPin)==0 && digitalRead(dahPin)==0) {
+    play(!last);
+    pause();  // FIXME. How are you going to handle the timing
+              // between this pause and the lock in play()?
+  }
+}
+
 void setup() 
 { 
+  pinMode(ditPin, INPUTPULLUP);
+  pinMode(dahPin, INPUTPULLUP);
+  
   if (Board = Uno) {
     // set up ditPin to read ditButton on regular Arduinos with 2 hardware interrups
     pinMode(ditPin, INPUT_PULLUP);
-    attachInterrupt(0, PlayDit, FALLING);
+    attachInterrupt(digitalPinToInterrupt(0), playDit, LOW);
     
     // set up dahPin to read dahButton on regular Arduinos with 2 hardware interrups
     pinMode(dahPin, INPUT_PULLUP);
-    attachInterrupt(1, PlayDah, FALLING);
+    attachInterrupt(digitalPinToInterrupt(1), playDah, LOW);
   }
   
   if (Board == Trinket) {

    //always be the same interrupt routine
  
    ISR(PCINT0_vect) {    
    if (digitalRead(ditPin)==0)  Serial.println("dit");
    if (digitalRead(dahPin)==0)  Serial.println("dah");
    }
  }
} 

/* 
This is vestigial. I may need the update stuff
as a reminder for the callback to play.
Once I'm done with those I should delete this.

// Interrupt is called once a millisecond, 
SIGNAL(TIMER0_COMPA_vect) 
{
  unsigned long currentMillis = millis();
  
  // if(digitalRead(2) == HIGH)
  {
     output1.Update(currentMillis);
  }
  
  output2.Update(currentMillis);
  output3.Update(currentMillis);
} 
 */
void loop()
{
}
    //always be the same interrupt routine
  
    ISR(PCINT_vect) {    
      if (iambic) {
        diDah(); // pin detection built into diDah()
      } else if {
        (digitalRead(ditPin)==0)  play(dit);
      } else if {
        (digitalRead(dahPin)==0)  play(dah);
      }
    }
  }

