Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I grab frames triggered by arduino? #33

Open
javierrenton opened this issue Aug 2, 2017 · 1 comment
Open

How can I grab frames triggered by arduino? #33

javierrenton opened this issue Aug 2, 2017 · 1 comment

Comments

@javierrenton
Copy link

I would like to ask you about some hints on how to grab the frames I obtained with an external Arduino trigger.
The frames are obtained with a Trigger Width Exposure mode, and Falling Edge configuration, 0/1 digital pin, from a given line. Whenever I try to get the frames from the buffer, I get in trouble.

Herein is how my code looks up to now:

#  This is my camera:
icam = py.InstantCamera(py.TlFactory.GetInstance().CreateFirstDevice())
icam.AcquisitionStart() 
# Trigger mode and exposure mode:
on_off=0
triggermode = ['On','Off']                        # Trigger mode, char 'On' or 'Off'
icam.TriggerMode = triggermode[on_off]
Nframes = time * FrameRate
if (icam.TriggerMode() == 'On'):
    icam.ExposureMode = 'TriggerWidth'
    icam.TriggerSource = 'Line4'
    icam.TriggerActivation = 'FallingEdge'
    icam.AcquisitionStatusSelector = 'FrameTriggerWait'
else: icam.ExposureTime = Texp;

* [...]    <-- External triggering, Arduino part of the code *

# we retrieve the set of frames:

 # to control how many pics we are grabbing:
itemnumb=0     
while(itemnumb <= Nframes):
     gray.append(icam.RetrieveResult)
     itemnumb+=1
# then we end the acquisition
icam.AcquisitionStop()

My intention is that gray has all the Nframes saved as a set of arrays

Thanks in advance!

@horsto
Copy link

horsto commented Nov 25, 2017

Hi! Does this code work? Did you gain any further insights into how to work with triggered acquisition?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants