Updated the Timeout function to include more arguments. It previously only allowed a user to set the duration in seconds, ie: fed3.Timeout(10); It now allows a user to set a "reset" boolean and a "whitenoise" boolean. These new arguments both default to "false" so if they are not set the Timeout function will behave as it previously did. If "reset" is set to "true" the Timeout will restart if the mouse pokes again at either poke. If "whitenoise" is set to "true", the FED3 will deliver a white noise stimulus through the entire Timeout.
Added a "jammed" mode which stops trying to dispense pellets after 100 attempts, instead of letting FED3 try to dispense all night when jammed. After 100 attempts, the FED3 will stop trying to dispense at this point and show "JAMMED... PLEASE CHECK" on the screen. FED3 will need to be reset to dispense again.
FED3 will no longer generate new filenames every time it restarts. FED3 previously would generate a new filename every time it booted up, resulting in a lot of empty FED3 files containing only headers with one line of data. FED3 will now re-use filenames if they have <2 lines of data in them. This results in a cleaner SD card without so many small files on it.
Added example for running a "2-armed Bandit" task, where probabilities of pellet delivery change on the two pokes (documentation of this code and task here: https://fed3bandit.readthedocs.io/en/latest/hardware/overview.html). This task can evaluate learning and behavioral strategy, as assessed by and "win-stay" or "lose-shift" behavior. See an example image below from a wildtype mouse learning a 100%/0% Bandit task over 3 days (black line is pellet probability on the Left poke alternating between 100% and 0% every 20 pellets, while blue line is the mouse behavior). There is also a recent publication from the Foldi lab using this task with FED3. Analyzing the Bandit task requires FED3 to log additional variables such as the probability of a pellet from each poke, and number of pellets before each switch. To log these variables, FED3 will check if the "session_type" is set to "Bandit", "Bandit80", or "Bandit100". If so, the code will add the following data to the logfile: "PelletsToSwitch", "Prob_left", "Prob_right", and "High_prob_poke".
Added a new variable: fed3.countAllPokes for use in behavioral scripts. This defaults to "true", so if you don't change it FED3 will act like prior behavior. But if you set this variable to "false" FED3 will no longer increment the Left and Right poke counts following pokes during dispense or with a pellet in the well. These pokes will still be logged but won't contribute to the LeftCount and RightCount totals on the screen or logfile.