Hello I'd like to send a ttl pulse when the pellet is dispensed separate from the one when its retrieved. I'm using Fed.feed(100) to account for the pellet taken and I tried to modify the FED3 C++ code to account for the dispensed using a prior example from the forum by inserting
//If pellet is detected during or after this motion
if (pelletDispensed == true) {
ReleaseMotor ();
pelletTime = millis();
BNC (150,1);
display.fillCircle(25, 99, 5, BLACK);
display.refresh();
retInterval = (millis() - pelletTime);
//while pellet is present and under 60s has elapsed
while (digitalRead (PELLET_WELL) == LOW and retInterval < 60000) { //After pellet is detected, hang here for up to 1 minute to detect when it is removed
retInterval = (millis() - pelletTime);
DisplayRetrievalInt();