Skip to content

4. Example Free Feeding Scripts

Kravitz Lab edited this page Dec 30, 2020 · 5 revisions

Free feeding: This script will drop a pellet

#include <FED3.h>                                       //Include the FED3 library 
String sketch = "FreeFeed";                                  //Unique identifier text for each sketch
FED3 fed3 (sketch);                                     //Start the FED3 object

void setup() {
  fed3.begin();                                         //Setup the FED3 hardware
  fed3.DisplayPokes = false;                            //Customize the DisplayPokes option to 'false' to not display the poke indicators
}

void loop() {
  fed3.run();                                           //Call fed.run at least once per loop
  fed3.Feed();                                          //Drop pellet
  fed3.Timeout(10);                                     //10 second timeout after each pellet is dropped (you can edit this number)
}
Clone this wiki locally