Dear Courtney,
Thank you for your response! This helps me out a lot!
The only problem I run into is that I only want to timestamp the moment the light turns off.
In my protocol my light turning off is followed by the light staying off for 30s.
Now I get a timestamp every second the light stays off. I have been struggling with a solution for a few days now but a lot of things that I tried affect other aspects of the protocol.
The part of the code that I want to timestamp looks like this:
////////////////////////////////////
//Present visual cue for Left trial
////////////////////////////////////
if (Left_trial == true) { //if it is a Left cue trial
if ((millis() - trial_start) < 30000) {
fed3.leftPokePixel(0, 10, 0, 0); //if it has been <30s since the start of the trial, turn left pixel ON (green)
}
else {
fed3.leftPokePixel(0, 0, 0, 0); //if it has been >30s since the start of the trial, turn left pixel OFF
fed3.Event = "OFF-left"; // Create string name for event when light turns off (omission)
fed3.logdata();
if (fed3.Right){
fed3.logRightPoke(); }
if (fed3.Left) {
fed3.logLeftPoke(); }
If someone knows a solution for how to timestamp one time or for 1 second that would be really helpful. I was thinking to make a 1 second timeout perhaps with a timestamp in the while loop.
Best,
Renée