I’m playing with the motorized focus camera and used the example code from your github.
While it is working fine, I’m having a hard time understanding what it is doing.
Hi,
1 – I understand it’s using bitwise operators but what is it calculating?
What is the purpose for dat1 and dat2?
This value is used to driver the motor current, Output current = (D[9:0]/1023) X 120mA
User can control the motor rotate different angles through changing different current.
the data1 is the value of D9-D4 and the data2 is the value of D0-D3.
2 – Is there any doc I can refer to?
For example, the chip and data address, are they fixed? Is it always 0 and 0x0c?
The chip address is 0x0C, for the detail information, please refer to https://www.arducam.com/downloads/DW9714A-DONGWOON(Autofocus_motor_manual).pdf
3 – What are the SCL and SDA pins for?
This signal is i2c bus and used to control the motor
4 – What are the min/max values for dat1 and dat2?
The value range of the dat1 is 0x00 - 0x3F. The value of the dat2 is 0x00-0x0F.