You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[Build your custom firmware](#build-your-custom-firmware)
28
29
-[Setting up the build environment (DIY method)](#setting-up-the-build-environment-diy-method)
@@ -209,6 +210,42 @@ import camera
209
210
vers = camera.Version()
210
211
```
211
212
213
+
### I2C Integration
214
+
215
+
The camera uses I2C (SCCB protocol) to communicate with the camera sensor. You can share this I2C bus with other devices by passing an external I2C object to the camera:
216
+
217
+
#### Sharing I2C with Camera
218
+
219
+
```python
220
+
import machine
221
+
222
+
# Create your own I2C object first
223
+
i2c = machine.I2C(0, scl=22, sda=21, freq=400000)
224
+
225
+
# Pass it to the camera (no need for sda_pin/scl_pin)
# The same I2C object can be used for other devices on the same bus!
229
+
devices = i2c.scan()
230
+
print(f"I2C devices found: {devices}")
231
+
232
+
# You can communicate with other I2C devices while camera is running
233
+
i2c.writeto(0x42, b'\x00\x01') # Write to another device
234
+
235
+
# Camera sensor communication works too
236
+
cam.set_saturation(1) # Uses the shared I2C bus
237
+
```
238
+
239
+
#### Alternative: Camera Creates Its Own I2C (Default)
240
+
241
+
```python
242
+
# Camera creates and manages its own I2C internally
243
+
cam = camera.Camera(sda_pin=21, scl_pin=22, ...)
244
+
245
+
# In this mode, you cannot share I2C with other devices
246
+
# Use the first method if you need to share I2C
247
+
```
248
+
212
249
### Additional information
213
250
214
251
The firmware images support the following cameras out of the box, but is therefore big: OV7670, OV7725, OV2640, OV3660, OV5640, NT99141, GC2145, GC032A, GC0308, BF3005, BF20A6, SC030IOT
0 commit comments