 // 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

int SHUT_LED   = LED4;
int EXPOSE_OUT = SIG5; // to exposure trigger
int EXPOSE_LED = LED5;


// Begin setup of board
void setup()

    turn_shutter(false);  // tell the shutter to close
    delay(postexposure);  // let the muscle rest
    turn_exposure(false); // reset cam trigger
    turn_ant(false);      // reset whap
//turn_ant(true);
//delay(250);
//turn_shutter(true);
//delay(100);
//turn_exposure(true);
//delay(100);
//turn_exposure(false);
//turn_shutter(false);
//turn_ant(false);
}

// Series of control functions
