Dear FED3 Community,
I am currently working on a fiber photometry project and have been integrating the FED3 system for controlling stimulus events and recording data. While setting up my code, I came across a forum post where a user mentioned using a Blink function to send TTL pulses to the TDT system. I am trying to use the function similarly in my code to trigger TTL pulses for different events, such as nose pokes and pellet retrieval, while recording the photometry signals.
Specifically, I am trying to use the Blink function as follows:
However, I am not sure if this Blink function is already defined by the FED3 library. If so, I would appreciate it if someone could guide me to where I can find the definition or documentation for it. If the function is not part of the library, I would like to ask for advice on how best to define it in my code.
For reference, here is the section of my code where I am attempting to use the Blink function:
#include <FED3.h> // Include the FED3 library
String sketch = "soundWindow"; // Unique identifier text for each sketch
FED3 fed3(sketch); // Start the FED3 object
// Other parts of the code...
void setup() {
fed3.begin(); // Setup the FED3 hardware
fed3.disableSleep();
Serial.begin(9600); // Initialize serial communication
fed3.DisplayPokes = true; // Enable poke indicators on the display
pinMode(BNC_OUT, OUTPUT); // Set up the TTL output pin
}
void loop() {
fed3.run(); // Run FED3 main logic
unsigned long currentTime = millis();
// Check for pellet retrieval
if (fed3.Feeding) { // If a pellet is dispensed
Blink(BNC_OUT, 200, 1); // Send TTL for pellet retrieval (1 pulse, 200 ms)
Serial.println("Pellet retrieved!"); // Print message
}
// Other logic...
}
Hopefully this does what you want!
Best, -Lex
--
You received this message because you are subscribed to the Google Groups "FEDforum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fedforum+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/fedforum/28e4a2e0-4d23-4080-8a59-6122350923dan%40googlegroups.com.