The CircuitPython imagecapture module is available on most supported RP2040 boards including the Raspberry Pi Pico.
This low-level module works together with a camera-specific high-level module such as adafruit_ov5640, to set up the camera.
Image storage
A 320×240 image at 16bpp takes about 150kB of RAM to store. The RP2040 has this much storage, but as memory can become fragmented, it's generally a good idea to allocate storage for the image just once at the beginning of your program. As shown in the example, a displayio.Bitmap
object can be used for this.
Pin choices
By selecting appropriate pins, you can use the adafruit_ov5640 library on other boards with the RP2040 microcontroller:
- xclk, pclk, vsync, href: Free choice of any pin
- reset, shutdown: Free choice of any pin. Can omit one or both, but the initialization sequence is less reliable.
- data_pins: Any 8 sequential pins in GPIO ordering (e.g., GPIO2..GPIO9).
By convention, if a board has an integrated camera or a dedicated camera connector, the following will exist in the board module:
- CAMERA_SIOC - the SCL pin of the camera
- CAMERA_SIOD - the SDA pin of the camera
- CAMERA_PCLK - the pixel clock of the camera
- CAMERA_VSYNC - the vertical sync of the camera
- CAMERA_HREF - the horizontal sync of the camera
- CAMERA_XCLK - the input clock pin of the camera
- CAMERA_DATA - the 8 data pins of the camera
Continue to the next page to see how to use the camera module with the Raspberry Pi Pico module on a permaproto board. Be prepared to do quite a bit of wiring & soldering for the required connections.
Page last edited March 08, 2024
Text editor powered by tinymce.