FED3 output

112 views
Skip to first unread message

Renée Poelman

unread,
Nov 9, 2022, 4:38:31 AM11/9/22
to FEDforum
Dear Lex,
I am working on a program for the FED3 to measure attention in mice. I was wondering if it is possible to receive more output parameters from the FED3?
For example, I would like to know the omissions (the light cue turning on and off without a nosepoke). Is it possible to timestamp when the light turns on and off? If I know that I can already calculate a few more parameters that I'm interested in.
Best,
Renée

Courtney Klappenbach

unread,
Nov 9, 2022, 1:06:01 PM11/9/22
to FEDforum
Hi Renée, 

We've been working on a Go/No-Go task and are therefore logging a lot of extra information from the FED (including light cues turning on and omissions). Here's how we've been doing it: 

Logging a light turning on (Flash): 
fed3.leftPokePixel(0,0,0,50) ;                      
fed3.Event =  "Flash-Left";          
fed3.logdata();     

Logging a light turning off (Omission): 
 if (poke == 1) {                                   
     fed3.Event = "Omit-LeftTrial";
     fed3.logdata();    }

 Note here that the variable 'poke' keeps track of whether a poke was made when the light was on. When it is equal to 1, no poke was made. 

My understanding is that you can change the fed3.Event to be any string and then the logdata function will write a line to the csv file with the event and the current time stamp. So you should be able to change the event to whatever you need for your task. 

I hope this helps!

Best, 
Courtney Klappenbach
Delevich Lab 

Renée Poelman

unread,
Nov 29, 2022, 8:20:00 AM11/29/22
to FEDforum
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


Op woensdag 9 november 2022 om 19:06:01 UTC+1 schreef courtney...@gmail.com:

Lex

unread,
Nov 29, 2022, 9:59:07 AM11/29/22
to Renée Poelman, FEDforum
Hi Renée,
It sounds like your main loop calls fed3.logdata() every second.  One solution could be to call fed3.Timeout(30) after you log data so the FED3 stays in the timeout for 30s and doesn't keep looping around and re-logging the data.  

If share your full .ino file I can take a closer look. Best, -Lex


--
You received this message because you are subscribed to the Google Groups "FEDforum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fedforum+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fedforum/6ee1bb5d-05d3-4e3e-9675-cca096b95dccn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages