Hello all,
We are working with a fixed ratio schedule that involves nose pokes and cued lights/sound. The basic protocol is thus:
1) fixed ratio 3 schedule
2) cued lights and sound go off
3) 5 second delay
4) pellet drops
I would like the FED, however, to not count nose pokes during the cues and until after the retrieval. This timeout period is important so the animal learns that it requires exactly 3 pokes (when the cues go off) and a timeout of 5 seconds for the subsequent pellet drop. However, it seems that if the animal continues to nose poke during the timeout period, they are counted towards the next pellet drop in the fixed ratio schedule (FR = 3). For example, say the animal pokes 3 times for the first pellet, and the animal continues to nose poke an additional 2 (5 times total) prior to the first pellet drop, then it only requires to nose poke one more time for the second pellet instead of an additional 3 times. How do I prevent registration of the nose pokes to being counted for the following pellet drop? That is, have the entire system go in a proper timeout until after the pellet retrieval?
Thanks so much!
Best,
Nachi
#include <FED3.h> //Include the FED3 library
String sketch = "FRCustom"; //Unique identifier text for each sketch
FED3 fed3 (sketch); //Start the FED3 object
int Delay_start = 1; //delay start
void setup() {
fed3.begin(); //Setup the FED3 hardware
fed3.Timeout (Delay_start); //(overnight) delay before task begins
fed3.FR = FR; //Share the FR ratio with the fed3 library so it is logged on the SD card and displayed on the screen
if (LeftActive == false) {
fed3.activePoke = 0; //update the activepoke variable in the FED3 library for logging and display. This defaults to 1, so only set to 0 if LeftActive == false
}
}
void loop() {
fed3.run(); //Call fed.run at least once per loop
// If Left poke is triggered
if (fed3.Left) {
fed3.logLeftPoke(); //Log left poke
if (LeftActive == true) {
if (fed3.LeftCount % FR == 0) { //if fixed ratio is met
fed3.Feed(); //deliver pellet
}
}
}
// If Right poke is triggered
if (fed3.Right) {
fed3.logRightPoke(); //Log Right poke
if (LeftActive == false) {
if (fed3.RightCount % FR == 0) { //if fixed ratio is met
fed3.Tone(4000, 1000);
fed3.pixelsOn(10, 10, 10, 10);
fed3.timeout = 1;
fed3.pixelsOff();
fed3.timeout = 4;
fed3.Feed(); //deliver pellet
}
}
}
}