ArduCAM / RaspberryPi

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

Issue using Python SMBus2 library in order to read from I2C register of the OV5642 #22

Open riccardobrue opened 4 years ago

riccardobrue commented 4 years ago

Hi, I am trying to use Python with the SMBus2 library in order to communicate with the OV5642 camera on a Raspberry Pi. Although it seems that the SPI side of the camera works well (using the spidev library on Python) there are issues while I am trying to read I2C registers with the SMBus2 library, what I read are just zeros. The steps that I am trying to do are these:

from smbus2 import SMBus
bus = SMBus(2)
b = bus.read_byte_data(0x3C, register_id)

I am trying to replicate the code inside the "arducam_i2c_word_read()" function in the C code here, but I am struggling and I don't knwo why. Is it possible to use this camera with python?

NOTE: I am tryin to read from the commod registers ids: 0x300A and 0x300B, but just zeros are retrieved.