Hello, I just would like to publish that I managed to successfully do the pin 9 modification based on Cesar's comments, and add some context in case anyone wants to do something similar.
We have a behavioral maze in which we have a beam break (an LED pointed at a photoresistor) which is triggered when the animal approaches the space in which the FED is located (this is connected to an Arduino). We then would like to track when the animal retrieves the pellet (ideally without having to look at the SD card data, but rather acquiring it in real-time).
To change the FED3 to do this, I needed to have the pin 9 as an input and the BNC as an output.
- In the FED3.h file, just add pin 9 as BNC_IN and switch A0 as BNC_OUT
In the FED3.CPP, initialize pin
- Then just uncomment this line of code in the dispenser function
Then, in arduino, I just send a pulse to pin 9 once the animal passes by and simultaneously send a pulse to the pi which initializes a timer (food_clk_start = time.process_time() )
When the animal collects the pellet, I send a pulse via BNC to the pi to signal the end of the timer (food_clk_end = time.process_time() - food_clk_start)
Maybe this is too simple, but hopefully it could help someone looking to do the same hack.
Vinicius