     digitalWrite(SHUT_LED, LOW);
     digitalWrite(EXPOSE_OUT, LOW);
     digitalWrite(EXPOSE_LED, LOW);
+    digitalWrite(STIM_OUT, LOW);
+    digitalWrite(STIM_LED, LOW);
     // Close out setup
     Serial.println("Setup complete");
 }



// Timing variables
const int PREDELAY  = 100;    // in ms
const int STEPDELAY = 10;     // in µs
const int EXPOSUREDUR = 100;  // in µs
const int POSTEXPOSURE = 100; // in ms

// Non-global variable declaration

}

// Control a run
void run(int predelay, int stimdelay, int shutterdelay, int stepdelay, int exposureduration, int postexposure)
{
    delay(predelay);
    digitalWrite(STIM_OUT, HIGH);
    digitalWrite(STIM_LED, HIGH);
    delay(stimdelay);
    digitalWrite(SHUT_OUT, HIGH); // shutter opened before step delay
    digitalWrite(SHUT_LED, HIGH); // may open during pre-delay in future
    delay(shutterdelay);
    digitalWrite(LEN_OUT, HIGH);
    digitalWrite(LEN_LED, HIGH);
    delayMicroseconds(stepdelay);
    digitalWrite(EXPOSE_OUT, HIGH);
    digitalWrite(EXPOSE_LED, HIGH);
    delayMicroseconds(exposureduration);
    digitalWrite(STIM_OUT, LOW);
    digitalWrite(STIM_LED, LOW);
    digitalWrite(EXPOSE_OUT, LOW);
    digitalWrite(EXPOSE_LED, LOW);
    digitalWrite(SHUT_OUT, LOW);
