Skip to content

2. Variables

Kravitz Lab edited this page Jan 3, 2021 · 23 revisions

These can be set or recalled in your sketch

  • String sketch: String, unique identifier text for each sketch (this will show up on the screen and in log file). Example:
String sketch = "FreeFeed";  
  • LeftCount: Int, total number of pokes on the left nosepoke, initializes to 0
  • leftInterval: Int, duration of the last left nosepoke in ms
  • RightCount: Int, number of pokes on the right nosepoke, initializes to 0
  • rightInterval: Int, duration of the last right nosepoke in ms
  • PelletCount: Int, total number of pellets dispensed, initializes to 0
  • retInterval: Int, how long the pellet remained in the well before it was taken in ms. Times out at 60000ms
  • minPokeTime: Int, minimum duration for a poke to count, in ms. Initializes to 0. Example:
fed3.minPokeTime = 1000;                               //Set minPokeTime to 1000ms
if (fed3.leftInterval > fed3.minPokeTime) {            //Check if the left poke held longer than minPokeTime
      fed3.Feed();                                     //Feed 
}
  • timeout: Int, a timeout period where FED3 will be unresponsive (in seconds). Initializes to 0. Example:
    fed3.timeout = 10; //Set a timeout period of 10 seconds, starting after each pellet is taken
  • Event: String, variable containing which type of event triggered the datalogging, options are Left, Right, or Pellet
  • EnableSleep: Boolean, defaults to "true". Set to "false" to disable sleep functionality. Turning off sleep will drain the battery much faster but can be useful when troubleshooting new programs. Example:
fed3.EnableSleep = false;                              //Turn off sleep functionality
  • FED3Menu: Boolean, defaults to "false". Set to "true" to run a simple menu system at startup to choose between programs
fed3.FED3Menu = true;                                  //Run menu at Startup
Clone this wiki locally