-
Notifications
You must be signed in to change notification settings - Fork 2
Writing A Behavioral Program
qmcgrath edited this page Feb 10, 2022
·
4 revisions
- Include library and name Force object
- Initialize force
- Call force.run() at least once per loop
- If the force lever is pressed hard enough for a sufficient length of time, the integer tracking the number of times the force was pressed is increased by one. If the ratio for number of presses it met, the code determines whether a progressive ratio session is active by checking the boolean PR variable. It then increases the force requirement by two grams each time the animal meets the hold time requirements and meets the force requirement. If the force requirement reaches a max value, it is reset to 2g. If the press number is not of the correct ratio, the device enters a timeout period. Users can feel free to modify this section to create their own custom progressive ratio task.
- Flash code and run!
- Include library and name Force object
- Initialize force
- Call force.run() at least once per loop.
- If the force lever is pressed hard enough for a sufficient length of time, the integer tracking the number of times the force was pressed is increased by one. Next, the code generates a random number between 1-3. If the number is 1 or 2, or about 66% of the time, a reward is dispensed and the force enters a timeout period. If the number is 3, or about 33% of the time, a tone is played. In addition, if the mouse licks the dispenser within 15 seconds a signal is played to pin 14 for 100 ms.
- Flash code and run!