if (fed3.currentHour >= fed3.timedStart && fed3.currentHour < fed3.timedEnd)
void setup() {
fed3.setTimed = true; //Set a flag to ask FED3 to edit "Timed Feeding" times when it enters the "Set Device Number" edit menu (this defaults to false)
fed3.begin(); //Setup the FED3 hardware
fed3.disableSleep(); //Disable sleep
delay (2000); //Delay 2s to allow user time to poke both pokes
if (fed3.Left && fed3.Right) { //If both pokes are activated during the mouse running screen
fed3.SetDeviceNumber(); //Enter "Set Device Number" edit menu to set device number and timed feeding hours
}
}
void loop() {
fed3.run(); //Call fed.run at least once per loop
if (fed3.currentHour >= fed3.timedStart && fed3.currentHour < fed3.timedEnd) { //If left poke is triggered and it's between the specified times
fed3.leftPokePixel(0, 10, 0, 0);
if (fed3.Left) {
fed3.logLeftPoke(); //Log left poke
fed3.ConditionedStimulus(); //Deliver conditioned stimulus (tone and lights for 200ms)
fed3.Feed(); //Deliver pellet
}
}
else { //If it's not between the specified times
fed3.pixelsOff();
if (fed3.Left) {
fed3.logLeftPoke(); //Log left poke
}
}
if (fed3.Right) { //If right poke is triggered
fed3.logRightPoke(); //Log right poke
}
}
--
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/79297d5b-0843-463e-9c20-d3307e296658n%40googlegroups.com.
Hi Lex,Thanks for your help! I tested it today and I can confirm that it works as expected.
To reinforce the idea of the beginning of the test I would like to add a sound at the beginning (and thus use only the light as a conditioned stimulus).Thus to replace the conditioned stimulus tone + light I replaced fed3.ConditionedStimulus(); by fed3.pixelsOn(0, 0, 10, 0); (and it works)To add a sound at the beginning of a session, do I have to add it in a new block and specify the start time?
Because if I put the command fed3.Tone (800, 500); after fed3.leftPokePixel(0, 10, 0, 0) the sound continuously loops during the time. Should i use fed3.stopTone(); ?
Thank you for your help,
BestDavid
To view this discussion on the web visit https://groups.google.com/d/msgid/fedforum/ae5233e6-d689-4b15-a9f5-380f712d8fc4n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fedforum/941953e2-eed8-46e3-aa6b-f194601e6442n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fedforum/f4da8098-fd90-4994-988b-3f9d66f8a6f5n%40googlegroups.com.