Creation of a program and a menu style setup

41 views
Skip to first unread message

Katherine McCullough

unread,
Mar 31, 2022, 9:03:52 AM3/31/22
to FEDforum
#1: Creation of a program in which both nosepokes are active, when triggered they will result in the light and sound and distribute a pellet. I thought this would be easy to add code to the existing Fr-1 program but having both active poke holes isn't working? 

#2 I am hopping to be able to drop the above program into your 'MenuExample2' program once I know what I was doing wrong. I think all of my down stream problems were from the above program. 

Thanks! 


Lex Kravitz

unread,
Mar 31, 2022, 11:20:01 AM3/31/22
to FEDforum
Hi Kate!
You can modify the FR1 program to have both pokes active by adding "fed3.ConditionedStimlus()" and "fed3.Feed()" into the "if (fed3.Right){}" statement.  See below, I added the lines in yellow to the FR1 example:

2022-03-31_10-18-02.jpg

I'm attaching a program that includes this edit, can you confirm that it works as you expect? Once you get this working you can add the entire code in the void loop() into the menu example.  I recorded a video showing how to do this but feel free to post back if you need more help.  Best, -Lex
FixedRatio1_BothPokes.ino

Katherine McCullough

unread,
Mar 31, 2022, 2:58:02 PM3/31/22
to FEDforum
Hi Lex!

Thank you so much for this. I am now having a problem with creating a menu and adding the 'closed economy PR' program to the menu format. It gives me an error that I have not set the reset value? 

Lex Kravitz

unread,
Mar 31, 2022, 9:45:47 PM3/31/22
to FEDforum
Hi Kate, can you post the code you're using and the error you're seeing?  The ClosedEconomy_PR1 program has some lines outside of the void loop() that you'll need to include.  These include some variables at the top in lines 19-23, and a "check_reset()" function in lines 60-78.  If you post your code I can see where you're stuck.  Best, -Lex

Katherine McCullough

unread,
Apr 1, 2022, 12:52:27 PM4/1/22
to FEDforum
Lex, 

When I attempted it again... it worked perfectly! Not sure what I was doing wrong the first time everything is working exactly as we want now! Thanks again for all your help!
Reply all
Reply to author
Forward
0 new messages