Skip to content

Version 1.16.0

Compare
Choose a tag to compare
@KravitzLab KravitzLab released this 06 Aug 20:10
· 32 commits to main since this release

Changes:

  1. Logging all pokes! FED3 now logs all pokes, even while FED3 is doing other things like dispensing pellets or in a timeout. To keep the different types of pokes straight in the logfile they are labeled in the "Event" column as:
    Left (The original! This means an active Left poke was detected)
    LeftShort (If you've set a minPokeTime and the duration of the Left poke is not long enough it will still log the short poke - see program example here)
    LeftWithPellet (Left poke with a Pellet in the well)
    LeftinTimeout (Left poke during a timeout)
    LeftDuringDispense (Left poke during dispensing, but before the Pellet has dropped)

These same variables are also logged for Right pokes. And the duration of all pokes are also logged in the "Poke_Time" column.

  1. Control an output voltage pulse when the pellet is removed. The Feed() function now has an optional argument to add an output pulse after the pellet is taken. This is useful for aligning with fiber photometry or other recordings. To send a pulse, give the fed3.Feed() function an optional argument noting the duration of the pulse. Useage:
    Calling fed3.Feed(100) will send a 100ms pulse when the pellet is taken.
    Calling fed3.Feed(500) will send a 500ms pulse when the pellet is taken.
    Calling fed3.Feed() will not send a pulse.

  2. Leaving the Neopixels on throughout the Feed() function. Due to this question from Marie Le May, I added another optional argument to FED3 to not turn the Neopixels off in the Feed functions. Normally, FED3 extinguishes the Neopixels when it detects a pellet. However, if you don't want them to turn off here, you can set a second optional second argument to false in the Feed() function. To do this, you need to set both optional arguments in the Feed() function:
    To leave the pixels on without sending a pulse call fed3.Feed(0, false);
    To leave pixels on with a 100ms pulse call fed3.Feed(100, false);
    And to do neither just call fed3.Feed().

You will need to call fed3.pixelsOff() to turn them off in this case. You also have to call fed3.disableSleep() in your setup loop if you plan to leave the Neopixels on for long durations, as their power will be cut when sleep modes are enabled.

  1. Set the FED3 clock without reflashing! The FED3 has an internal real-time clock chip called the PCF8523. Unfortunately this clock does not have high precision and can drift a couple seconds per week, which adds up over time. You can flash the SetClock script (in the FED3 Examples) to re-set the clock to your computer's local time, but this requires re-flashing the device. I've now added a simple way to adjust the clock on the device itself. At startup, hold both pokes while the mouse is running across the screen. This will enter a small settings menu, where you can first set the number of the device with the Left and Right pokes. Once the device number is set, wait 3s and it will switch to a clock adjust mode. Here, the pokes will let you set the time forwards or backwards. When you're happy just wait and the FED3 will reset itself, keeping the new time.