Re: Left Poke log counting up uncontrollably

Skip to first unread message


Jul 27, 2023, 4:24:24 PM7/27/23
to Megan McGraw, FEDforum
Hi Megan,
I took a quick look and I see a small issue.  In "Left_Motivated_Behavior_Final.ino" line 199 you are asking if the fed3.Right is triggered and then calling logLeftPoke() instead of logRight Poke().  I think if you fix that it will work. Please post back if that fixes it! 


To explain what's going on: when you poke Left or Right it sets a variable fed3.Left or fed3.Right to be true, respectively.  The FED3 code then does things based on that variable being true, and when it finishes logging data it sets fed3.Left or fed3.Right back to false, completing the poke. In your case, when you poke on the right it will set fed3.Right to be true, but then your code calls fed3.logLeftPoke, which will increment the left count but then set fed3.Left (and not fed3.Right) back to false. So when the code goes around again it will keep acting like the Right poke has been triggered, and calling fed3.logLeftPoke (which increments the LeftCount).  Anyway hope this fixes it!  -Lex

On Thu, Jul 27, 2023 at 1:42 PM Megan McGraw <> wrote:
Hi all,

I have discovered a weird glitch in my code. I have two versions of the same code. 1 for right nose poke being correct and one for left nose poke being correct. My final mode is the progressive ratio mode but combined with the closed economy check reset function. I have discovered that only on my left nose poke code that if the mouse doesn't collect their pellet within a certain time frame, the left nose poke count goes up until I turn off the fed and rendering it unusable. I have attached both my right and left code. I have gone through them and I can't see any differences that would cause this glitch. 

Thank you for any help,

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
To view this discussion on the web visit
Reply all
Reply to author
0 new messages