adafruit / Adafruit_CircuitPython_PyCamera

Library for the Adafruit PyCamera
https://docs.circuitpython.org/projects/pycamera
MIT License
17 stars 9 forks source link

WIP enabling autofocus #2

Closed jepler closed 1 year ago

jepler commented 1 year ago

I can see the autofocus state machine go through several states when I request autofocus but it doesn't seem to actually change the focus (nothing on the viewfinder gets any sharper, and there's not the slight change in FOV I associate with a focus change)

SEL
32
release focus                        status=70 busy?=00
autofocus                            status=00 busy?=00
0
autofocus status 20 -> 00
autofocus status 00 -> 10
autofocus status 10 -> 20
autofocus status 20 -> 00
autofocus status 00 -> 10
autofocus status 10 -> 20
autofocus status 20 -> 00
autofocus status 00 -> 10
autofocus status 10 -> 20
autofocus status 20 -> 00
autofocus status 00 -> 10
autofocus status 10 -> 20

typical output .. at the top the SEL button has been pressed to begin autofocus. Status goes through 0x70 (idle), 0x00 (focusing) and 0x10 (focused). It also goes to an undocumented state (0x20) and then loops back 00 -> 10 -> 20 without additional presses of SEL, once every few seconds after the first press of the autofocus button.

ping @ladyada

ladyada commented 1 year ago

oh you have to solder the jumper closed below the camera, that will power the motor

jepler commented 1 year ago

after doing that it does seem to focus! however, putting it on the "SEL" button is probably not ideal. I will look into what you were suggesting about short/long shutter presses.

ladyada commented 1 year ago

thank you! <3

jepler commented 1 year ago

Now you can enter the LED setting modes with the left/right buttons, and cycle through some modes with up/down:

"white" uses the W LED element, not the RGB elements.

jepler commented 1 year ago

Now the shutter button does focus + capture:

jepler commented 1 year ago

@ladyada wanna test or should I just jab the merge button?

ladyada commented 1 year ago

jabbed! and will test