from datetime import timedelta

import dv_processing as dv

# Open a Davis camera
capture = dv.io.camera.DAVIS()

# Enable frame auto-exposure (default behavior)
capture.setAutoExposure(True)
# Disable auto-exposure, set frame exposure (here 10ms)
capture.setAutoExposure(False)
capture.setExposureDuration(timedelta(milliseconds=10))
# Read current frame exposure duration value
duration = capture.getExposureDuration()
# Set frame interval duration (here 33ms for ~30FPS)
capture.setFrameInterval(timedelta(milliseconds=33))
# Read current frame interval duration value
interval = capture.getFrameInterval()
