Skip to content

Python demo & C demo

Python demo

Arducam has released two demos:, and


You need to perform the following steps first:

  • Step 1. Install dependencies
sudo apt-get upgrade
sudo apt install -y python3-kms++ python3-libcamera python3-pip
sudo apt install -y python3-pyqt5 python3-prctl libatlas-base-dev ffmpeg
sudo pip3 install numpy --upgrade
sudo pip3 install picamera2 opencv-python  
  • Step 2. Install the driver and libcamera

Please find the corresponding driver installation method of your camera in the following two links, and then execute the subsequent commands.


If you do not find your camera please contact us.(

  • Step 3. Download library
git clone
  • Step 4. Enable i2c
cd /home/pi/RaspberryPi/Motorized_Focus_Camera
sudo chmod +x

Press Y to reboot



  • This demo supports auto focusing in preview mode, You can see the focus visually

  • Click the ‘F’ button to achieve autofocus, click the ‘Q’ button to exit and save the /picture
cd /home/pi/RaspberryPi/Motorized_Focus_Camera/python/
python3 -i 10

  • Example of manual focus

cd /home/pi/RaspberryPi/Motorized_Focus_Camera/python/
python -i 10


C demo

cd cd /home/pi/RaspberryPi/Motorized_Focus_Camera/C/
make install