KravitzLabDevices / FED3_library

GNU General Public License v3.0
6 stars 17 forks source link

Add argument for pulse length to BNC out function #43

Closed KravitzLab closed 2 years ago

KravitzLab commented 2 years ago

Solution provided by Eric Casey to add an argument to the BNC function to also adjust pulse length:

In the header, replace the old line for BNC function for this one: void BNC(byte DELAY_MS, byte loops, byte TTL_duration = 0);

In the cpp, replace the old BNC function definition for this one:

//Short helper function for controlling the BNC port void FED3::BNC(byte DELAY_MS, byte loops, byte TTL_duration) { if (TTL_duration==0) TTL_duration=DELAY_MS; for (byte i = 0; i < loops; i++) { digitalWrite(BNC_OUT, HIGH); digitalWrite(GREEN_LED, HIGH); delay(TTL_duration); digitalWrite(BNC_OUT, LOW); digitalWrite(GREEN_LED, LOW); delay(DELAY_MS); } }

KravitzLab commented 2 years ago

Updated this function in FED3 library v1.12.0