 
 #define WIDTH     ((sizeof(T) / sizeof(T[0])) * 2)
 #define N_BUTTONS ((sizeof(T) / sizeof(T[0])) * 16)
+
+// Encoder on pins 4,5 sets tempo.  Optional, not present in
+// standard OONTZ, but won't affect things if unconnected.
+enc e(4, 5);
 
 uint8_t       grid[WIDTH];                 // Sequencer state
 uint8_t       heart        = 0,            // Heartbeat LED counter

  uint8_t       mask;
  boolean       refresh = false;
  unsigned long t       = millis();

  if((t - prevReadTime) >= 20L) { // 20ms = min Trellis poll time
    if(oontz.readSwitches()) {    // Button state change?

    }
    prevBeatTime = t;
    refresh      = true;
    bpm          = e.getValue() / 4; // Div for encoder detents
    beatInterval = 60000L / bpm;
  }

  if(refresh) oontz.writeDisplay();
