Hi Laura! Super cool you're doing this! How are you wiring the pump up to the FED3 BTW? Are you using the motor header inside of FED3? The FED3 code is configured to control a stepper motor and not a DC motor like what's in the peristaltic pump. I'm not surprised you're getting strange behavior if you just connected a DC motor to the pin headers.
So I think your options are to:
1) Keep hardware hacking! Try connecting the motor to different pins, make sure one of them is connected to ground (the outer-most pin on the header), perhaps connected to multiple stepper pins, see if anything works the way you want it to.
2) Keep code hacking! It sounds like you have it working fine with one poke, it's just multiple pokes while dispensing that mess it up. If you simplify the void FED3_Sip::Feed function to stop monitoring for additional pokes it might work for you. So the logic is change this function to move the pump as much as you need to, without allowing for additional poke reads in that function. You can also put a delay(2000); or something at the end to just make sure the motor finishes before another poke is allowed to be detected.
3) (most correct method and also the most work) Remove the stepper control code in the FED3 library and configure the TB6612 motor driver chip inside FED3 to control your pump instead of the stepper. The TB6612 chip is capable of controlling a DC motor but it will require a re-write of how FED3 handles the motor to make this work correctly. See
here for examples. If you do this you can get experience with how the chip works by buying that break-out board and using it to follow the examples on the Sparkfun page, and once you understand it you can wire the chip inside of FED3 up to the pump.
Your other issue is easier :) The poke delaying the motor are expected - whenever a poke is made the system waits until the poke is clear so it can time how long the poke is. Mouse pokes are typically <200ms so it's not super noticeable but that's happening all the time. To stop that behavior you can comment out these lines in the log poke functions:
while (digitalRead (RIGHT_POKE) == LOW) {} //Hang here until poke is clear
while (digitalRead (LEFT_POKE) == LOW) {} //Hang here until poke is clear
You'll just lose the ability to have an accurate PokeTime column, but it sounds like you might not care about that and doing this this might solve your other issue.
Good luck! -Lex