13.04.2015 Views

Blackfly - CYLOD

Blackfly - CYLOD

Blackfly - CYLOD

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Point Grey <strong>Blackfly</strong> Technical Reference<br />

Appendix C: FlyCapture API Code Examples<br />

Appendix C: FlyCapture API Code Examples<br />

C.1 Example: Setting a GPIO Pin to Strobe Using the FlyCapture API<br />

The following FlyCapture 2.x code sample uses the C++ interface to do the following:<br />

• Configures GPIO1 as the strobe output pin.<br />

• Enables strobe output.<br />

• Specifies an active high (rising edge) strobe signal.<br />

• Specifies that the strobe signal begin 1 ms after the shutter opens.<br />

• Specifies the duration of the strobe as 1.5 ms.<br />

Assuming a Camera object cam:<br />

StrobeControl mStrobe;<br />

mStrobe.source = 1;<br />

mStrobe.parameter = 0;<br />

mStrobe.onOff = true;<br />

mStrobe.polarity = 1;<br />

mStrobe.delay = 1.0f;<br />

mStrobe.duration = 1.5f<br />

cam.SetStrobeControl(&mStrobe);<br />

C.2 Example: Setting a Standard Video Mode, Format and Frame<br />

Rate Using the FlyCapture API<br />

The following FlyCapture code snippet sets the camera to: 640x480 Y8 at 60 FPS.<br />

Camera.SetVideoModeandFrameRate( VIDEOMODE_640x480Y8 , FRAMERATE_60 );<br />

C.3 Example: Asynchronous Hardware Triggering Using the<br />

FlyCapture API<br />

The following FlyCapture 2.x code sample uses the C++ interface to do the following:<br />

• Sets the trigger mode to Trigger Mode 0.<br />

• Configures GPIO0 as the trigger input source.<br />

• Enables triggered acquisition.<br />

• Specifies the trigger signal polarity as an active high (rising edge) signal.<br />

Assuming a Camera object cam:<br />

Revised 12/13/2012<br />

Copyright ©2012 Point Grey Research Inc.<br />

76

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!