Skip to content

Add AutoFocus #32

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

Merged
merged 7 commits into from
May 28, 2024
Merged

Add AutoFocus #32

merged 7 commits into from
May 28, 2024

Conversation

jerryneedell
Copy link
Contributor

@jerryneedell jerryneedell commented May 26, 2024

Added auto focus control functions - see #31 - copied from adafruit_pycamera with minor changes to the timeouts.
Reorganized the library as a "package" so the ov5640_autofocus.bin file could be included in the package.

The usage is the same as for the pycamera library
To execute an autofocus:

cam.autofocus()

to set the focus to a fixed step (0-255)

cam.autofocus_vcm_step=step

new examples:
ov5640_jpeg_captutre_af.py
ov5640_jpeg_capture_manual_focus.py
Have been added.

This has been tested on a Rasbperry Pi Pico with the PiCowBell ov5640 autofocus camera breakout board.
It was also tested on a PicoW -- one change was needed to avoid running out of memory on the PicoW
Change

b = bytearray(cam.capture_buffer_size)

to

b = bytearray(cam.width*cam.height//5)

This is discussed in #26

@jerryneedell jerryneedell requested a review from jepler May 26, 2024 16:18
Copy link
Contributor

@jepler jepler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks! didn't test.

@jepler jepler merged commit 8013c70 into adafruit:main May 28, 2024
1 check passed
@jerryneedell jerryneedell deleted the jerryn_af branch May 28, 2024 15:34
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request May 30, 2024
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

Successfully merging this pull request may close these issues.

2 participants