 // Control a run
 void run(int predelay, int antdelay, int shutterdelay, int exposuredur, int postexposure)
 {
-    delay(predelay);      // just to let things settle
-    //turn_ant(true);       // whap the ant
-    //delay(antdelay);      // wait for motor movement
+//    delay(predelay);      // just to let things settle
+//    turn_ant(true);       // whap the ant
+    while(!digitalRead(STIM_IN)){
+      delayMicroseconds(2);
+    }
+    delay(antdelay);      // wait for motor movement
     turn_shutter(true);   // tell the shutter to open
     delay(shutterdelay);  // let the shutter physically respond
     turn_exposure(true);  // tell the camera to take a pic

    pinMode(SHUT_LED, OUTPUT);
    pinMode(EXPOSE_OUT, OUTPUT);
    pinMode(EXPOSE_LED, OUTPUT);
    // Initial pin states
    turn_ant(false);
    turn_shutter(false);

int SHUT_LED   = LED4;
int EXPOSE_OUT = SIG5; // to exposure trigger
int EXPOSE_LED = LED5;
int STIM_IN    = SIG3; // to stimulus trigger
int STIM_LED   = LED3;

// Begin setup of board
void setup()
