Detecting whether the nose poke is active

51 views
Skip to first unread message

Caleb Darden

unread,
Aug 9, 2023, 9:30:56 AM8/9/23
to FEDforum
Hi,

I'm using FED3 with the kesner/lovinger lab and am writing code to put a progressive ratio task on the FED3. I've found myself stuck on an aspect of the training session and was hoping for some help.

I'm trying to train mice to hold their nose in the port for 500ms (at which point a light will turn on) and then remove their nose within 1 second of that stimulus to receive a reward. If they remove their nose prematurely (prior to the lights coming on), they receive no reward and a 3 seconds timeout. If they meet the 500ms requirement but leave their nose in for more than 1s after the lights come on, no reward will be delivered.

I'm struggling with establishing and enforcing this time window. Specifically, writing code that will determine the state of the nose poke (beam broken or not). this can observed toward the top of the sketch at 'bool isNoseRemoved()'. 

I have attached my code to the post. Any guidance on how to execute this would be great! Thank you in advance.

Best,
Caleb
FED_training_SESSION10_Workinprogress.ino
FED_training_SESSION10_Workinprogress.ino

Lex

unread,
Aug 9, 2023, 12:46:42 PM8/9/23
to Caleb Darden, FEDforum
Hi Caleb!
If you check out the FED3 example "FixedRatio1_MinPokeTime" (under Beta_Programs, see photo below) it may help you.  This example just asks if the Left poke duration (fed3.leftInterval) is > 1000ms, but you could add a second contingency such that after they poke the FED3 decides:
1) if fed3.leftInterval is < 500 enter a 3s timeout
2) if fed3.leftInterval is between 500 and 1000 ms they get a reward
3) if fed3.leftInterval is > 1000 they get lights but no reward.

I think this logic might do what you want?  Best, -Lex


image.png


--
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/d309c02c-4c59-46d4-a289-640096f41be2n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages