adafruit / Adafruit_CircuitPython_OV2640

CircuitPython driver for OV2640 cameras
MIT License
10 stars 3 forks source link

code stuck on `cam.capture` #24

Open nadavmisgav opened 1 year ago

nadavmisgav commented 1 year ago

using ov2640 camera with internal XCLK generation of 24MHz, and when i run

import time

import board
import busio
import digitalio
from adafruit_ov2640 import OV2640, OV2640_COLOR_JPEG, OV2640_SIZE_QVGA

with busio.I2C(scl=board.GP5, sda=board.GP4, frequency=100_000) as bus:
    print("[*] init camera")
    cam = OV2640(
        bus,
        data_pins=[
            board.GP6,
            board.GP7,
            board.GP8,
            board.GP9,
            board.GP10,
            board.GP11,
            board.GP12,
            board.GP13,
        ],
        clock=board.GP14,
        href=board.GP15,
        vsync=board.GP16,
        mclk=None,
        reset=board.GP2,
        shutdown=board.GP17,
        size=OV2640_SIZE_QVGA)

    cam.colorspace = OV2640_COLOR_JPEG

    print("[*] product id:", hex(cam.product_id))
    print("[*] product version:", hex(cam.product_version))
    print("[*] width:", cam.width, "height:", cam.height)

    buf = bytearray(cam.capture_buffer_size)
    print("[*] capturing")
    cam.capture(buf)
    print("[*] done")

the code is stuck on capture, any ideas ?