Hi all! We seem to be working on a very similar application! Check out our project here, based on the M7, it works super well for detecting animals!
We also would like it to trigger a TTL line when the animal is in one half of the box. However I’m having a weird issue with this at the moment. We are using the LCD shield, and are using P6 for an output to take advantage of the DAC and ADC for future applications (I guess for this application we could use any free pin). We also physically disconnected P6 from the LCD shield so our pulses on P6 wouldn’t also do brightness control.
Long story short, when I hook P6 up to an oscilloscope I see output as expected, it goes high (3.3V) when the centroid of the blob is <80 (see code below). However, when I hook P6 up to equipment (an LED driver) nothing happens. It doesn’t seem to source enough current to trigger the LED driver. Any ideas on why P6 wouldn’t be able to trigger an LED driver? Is there something special I need to do with P6 to enable it to work this way?
We’re setting up the output on P6 in the code with:
# Set up Analog Output
dac = pyb.DAC(pyb.Pin('P6'))
And triggering the output during the loop with:
if centroid < 80: