Skip to content

WIP enabling autofocus #2

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 10 commits into from
Nov 17, 2023
Merged

WIP enabling autofocus #2

merged 10 commits into from
Nov 17, 2023

Conversation

jepler
Copy link
Contributor

@jepler jepler commented Nov 15, 2023

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
Copy link
Member

ladyada commented Nov 15, 2023

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

@jepler
Copy link
Contributor Author

jepler commented Nov 15, 2023

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
Copy link
Member

ladyada commented Nov 15, 2023

thank you! <3

show & return the focus zones. In my testing, the focus zone was either
all zeros, or the last zone. I think this is because "default zone
mode" uses a single zone at the center of the sensor.
@jepler
Copy link
Contributor Author

jepler commented Nov 16, 2023

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

  • brightness: 0, .1, .2, .5, 1
  • colors: white, red, orange, yellow, green, cyan, blue, magenta, rainbow

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

@jepler
Copy link
Contributor Author

jepler commented Nov 16, 2023

Now the shutter button does focus + capture:

  • short press alone: capture
  • long press alone: focus
  • short press + long press: focus, then capture
    so the SEL button can re-purposed for switching colors if desired (but this is done with the directional buttons right now)

@jepler jepler marked this pull request as ready for review November 16, 2023 19:28
@jepler
Copy link
Contributor Author

jepler commented Nov 16, 2023

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

@ladyada ladyada merged commit af5e630 into main Nov 17, 2023
@ladyada
Copy link
Member

ladyada commented Nov 17, 2023

jabbed! and will test

@dhalbert dhalbert deleted the autofocus-etc branch September 26, 2024 20:08
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