ArduCAM / RaspberryPi

This is Arducam camera demos used on Raspberry Pi paltform
BSD 3-Clause "New" or "Revised" License
162 stars 97 forks source link

manualFocusPreview - How to Save Settings #60

Open cherbin opened 2 years ago

cherbin commented 2 years ago

Hello,

The manualFocusPreview.c works with the focus.

Once you exit the program , the camera does not keep/save the current focus value..

How do you save the focus value so that when you run the raspistill from command line so it has the previous focus position ?

vcm_write seems to be only temporary when until the camera turns off.

Exscotticus commented 2 years ago

Same question. I'm running a headless Pi and don't even have a GUI preview option. I tried both extremes and compared images taken with raspistill. No difference in focus.

Here's my methodology...

pi@raspberrypi:~ $ cd RaspberryPi/Motorized_Focus_Camera/python
pi@raspberrypi:~/RaspberryPi/Motorized_Focus_Camera/python $ python3
Python 3.7.3 (default, Jan 22 2021, 20:04:44) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from ctypes import *
>>> arducam_vcm = CDLL('./lib/libarducam_vcm.so')
>>> arducam_vcm.vcm_init()
0
>>> arducam_vcm.vcm_write(0)
255

Now I take a pic and download it.

>>> arducam_vcm.vcm_write(1023)
255

Now I take another pic, download it, and compare the two.

Note the return values of 255. I believe that indicates failure to execute. 0 indicates success.