Send TTL to Bonsai Open Ephys

I am fairly new to Arduino and I have to use Arduino and Bonsai Open Ephys to run multiple components of an experiment I am conducting. Part of the experiment is a water dropper controlled by an Arduino program, and I need Bonsai to record these water drops. I would like to be able to send an input to Bonsai every time the water drop is cued by Arduino, so that the water drop is recorded synchronously with the other information that is being recording by Bonsai.

I understand that I need to use Firmata but I've been having trouble finding much documentation on how to do this. I've written a test code that simply cues TTL pulses every 5 seconds for the purposes of testing my system. I've gotten started on implementing the firmata code but most of the support I find for this is how to use Analog messages through the Serial port... ideally it seems more straightforward if I could just send a redundant copy of the water drop TTL over to Bonsai.

I've copied the test code I've written. I've highlight the sections regarding Firmata that I'm not sure about. Thanks so much for your help! I imagine this should be pretty easy if I just knew what I was doing with Firmata.

#include <Boards.h>
#include <Firmata.h>
#include <FirmataConstants.h>
#include <FirmataDefines.h>
#include <FirmataMarshaller.h>
#include <FirmataParser.h>

int testPin = 13;
byte sendPin = 13;
int pulsewidth = 900;
int trialN = 56;
int t = 0;

void setup() {
// put your setup code here, to run once:

pinMode(testPin, OUTPUT);

** Firmata.begin();**

void loop() {
for(int t=0; t < (trialN-1); ++t){

//Turn on pulse
digitalWrite(testPin, HIGH);
Firmata.sendDigitalPort(sendPin, int portData);
digitalWrite(testPin, LOW);


I understand that I need to use Firmata

Using Firmata means that the Arduino is a moron. It can respond to any (reasonable) request, but it can not initiate actions.

I don't know what you think that bold line is supposed to do, but it won't compile.