if statement in ISR changeindex() to stop experiment could be replaced by detachInterrupt and therefore making ISR faster
if statement in ISR changeindex() to stop experiment could be replaced by detachInterrupt and therefore making ISR faster