-
Notifications
You must be signed in to change notification settings - Fork 19
3. Functions
Kravitz Lab edited this page Jan 25, 2021
·
21 revisions
Poke functions.
- logLeftPoke(): Causes FED3 to increment LeftCount and log the left poke and duration to the SD card
- logRightPoke(): Causes FED3 to increment RightCount and log the right poke and duration to the SD card
- Timeout(int seconds): Causes FED3 to enter a "timeout" where nothing is active for the specified number of seconds
Feeding functions
- Feed(): Causes FED3 to drop a pellet. FED3 will continue attempting to drop pellet until it is detected in the pellet well, and will initiate jam clearing operations automatically if it fails to dispense on the following schedule: Every 5th attempt (MinorJam); Every 10th attempt (VibrateJam); Every 10th attempt (ClearJam). Once it detects a pellet it increments PelletCount and waits for up to 60 seconds for the pellet to be removed so it can calculate retInterval. When pellet is removed it will send a 500ms pulse to the BNC port.
- MinorJam(): Causes FED3 pellet disk to make a small backwards movement
- VibrateJam(): Causes FED3 pellet disk to make a vibrating movement for ~10 seconds, stopping this movement if a pellet is detected
- ClearJam(): Causes FED3 pellet disk to make a full rotation backwards and forwards, stopping this movement if a pellet is detected
Audio and Neopixel functions
- pixelsOff(): Turn all Neopixels off
- ConditionedStimulus(): Turn all pixels on a green/blue color and a 4000Hz tone for 200ms
- leftStimulus(): Turn on left-most pixel. Note: you must have EnableSleep set to false to keep this pixel lit
- rightStimulus(): Turn on right-most pixel. Note: you must have EnableSleep set to false to keep this pixel lit
- Click(): Short "click" (800Hz tone for 8ms)
- Noise(duration): Random noise stimulus of a set duration. Note: This function uses delay() and is blocking!
- Tone(frequency, duration): Tone of set frequency and duration. Good news: This function is not blocking!
FED3 BNC port
- BNC(delay, number): Send number of pulses of length delay from the BNC output port. Note: This function uses delay() and is blocking! Example:
fed3.BNC(20, 5); //send five 20ms pulses from the BNC port
- ReadBNC(): Set the BNC port to be an input and read it. If it goes HIGH it will set the variable BNCinput to true. Example:
fed3.ReadBNC();
Display functions
- UpdateDisplay(): Update all values on FED3 display
SDcard logging functions
- logdata(): Log current data to the SD card. This will print one line to the data file containing the following fields:
MM:DD:YYYY hh:mm:ss, LibaryVersion_Sketch, Device_Number, Battery_Voltage, Motor_Turns, Trial_Info, FR, Event,
Active_Poke, Left_Poke_Count, Right_Poke_Count, Pellet_Count, Block_Pellet_Count, Retrieval_Time, Poke_Time
Sleep functions
- disableSleep(): Disable sleep functionality. Call in setup loop. Example:
fed3.disableSleep();