FEDS cue discrimination program

153 views
Skip to first unread message

A R

unread,
Dec 7, 2022, 4:59:40 PM12/7/22
to FEDforum

Hi! I am new to programing the FEDS. I need help programming the FED3 to do two different tones for Pavlovian conditioning. One of the tones (tone 1)  shall precede a pellet, and the second will just be a different tone and have no following consequence. So it would be Tone 1(pellet)-Tone2(no pellet)-Tone1(pellet) etc. I need this to do for tone discrimination with my animals. Any tips on how to program this?

This is what I have rn: 
Screen Shot 2022-12-07 at 1.12.14 PM.png

Lex

unread,
Dec 8, 2022, 9:01:03 AM12/8/22
to A R, FEDforum
Hi Arturo!  
You can see the available functions for FED3 here, instead of fed3.ConditionedStimulus(); you will want to use fed3.Tone (freq, duration) to play a tone of a specified 
freq and duration, and then either follow this with fed3.Timeout (for no-pellet trials), or fed3.Feed() (for pellet trials).  See attached code, void loop pasted here:

void loop() {
  fed3.run();                                           //Call fed.run at least once per loop

  //unrewarded tone
  fed3.Tone(1000, 200);                                 //1Khz tone
  fed3.Timeout(Pellet_delay);                           //delay after tone
 
  //rewarded tone
  fed3.Tone(4000, 200);                                 //4Khz tone  
  fed3.Timeout(Pellet_delay);                           //delay between tone and pellet
  fed3.Feed();                                          //Drop pellet
 
  while (digitalRead (PELLET_WELL) == LOW) {            //Wait here while there's a pellet in the well
    delay (10);
  }
}

Let me know if this points you in the right direction!  Best, -Lex


On Wed, Dec 7, 2022 at 3:59 PM A R <arturo.riv...@gmail.com> wrote:

Hi! I am new to programing the FEDS. I need help programming the FED3 to do two different tones for Pavlovian conditioning. One of the tones (tone 1)  shall precede a pellet, and the second will just be a different tone and have no following consequence. So it would be Tone 1(pellet)-Tone2(no pellet)-Tone1(pellet) etc. I need this to do for tone discrimination with my animals. Any tips on how to program this?

This is what I have rn: 

--
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/95ea51b1-a6c8-42fb-8524-4762e4cdb031n%40googlegroups.com.
Pavlovian_inactivetone.ino

A R

unread,
Dec 13, 2022, 11:55:43 AM12/13/22
to FEDforum
Thank you, it worked! I am trying to randomize which tone is presented, but I've had no luck. Any tips for that?

Cordially,
Arturo

Lex Kravitz

unread,
Dec 15, 2022, 11:36:03 AM12/15/22
to FEDforum
Hi Arturo,
This is a great question - I recorded a video explaining how to randomly switch between two states on FED3 (ie: rewarded vs. unrewarded tones).  You can also familiarize yourself with the Arduino random() function, which is what I used for this.

One subtlety that I didn't cover in the video is that getting a computer to generate a truly random sequence is trickier than it sounds.  The random() function selects a *pseudorandom* sequence of numbers, meaning that this sequence will be identical each time you reset the FED3.  This can be a good thing for experiments, but if you want a *different* sequence each time you reset the FED3, you will have to set a different randomSeed() each time.  You can read about this issue and solution in an excellent description here.  I implemented this in the attached code so it will deliver a different sequence each time.  If you want the same sequence to occur you can comment out line 25 in the attached code:

Untitled.png

Have fun!  -Lex
Pavlovian_inactivetone_random.ino

A R

unread,
Jan 26, 2023, 11:08:45 AM1/26/23
to FEDforum
Good morning! 

(I already sent it before, but it doesn't appear in this conversation, so I apologize if it looks like spam!)

First of all, thank you for all the advice! Thanks to your pointers, I've improved using the random function and programming the FEDs. I've managed to change the Pavlovian script to our needs with what I've learned here. Is it possible to disable the sensor in the food tray so that trials may continue even with pellets in the tray? I know it might lead to jams, but I would still like to try. I appreciate any help you can give me.

Cordially,
Arturo

Lex Kravitz

unread,
Jan 26, 2023, 2:39:08 PM1/26/23
to FEDforum
Hi Arturo,
I'll re-post this question and answer in a new thread as it asks about a new topic.  Best, -Lex
Reply all
Reply to author
Forward
0 new messages