{"id":15023421,"url":"https://github.com/adafruit/adafruit_circuitpython_ov5640","last_synced_at":"2026-03-09T07:31:42.839Z","repository":{"id":43003989,"uuid":"412501619","full_name":"adafruit/Adafruit_CircuitPython_OV5640","owner":"adafruit","description":"CircuitPython driver for OV5640 Camera","archived":false,"fork":false,"pushed_at":"2025-01-16T19:02:09.000Z","size":194,"stargazers_count":6,"open_issues_count":7,"forks_count":3,"subscribers_count":18,"default_branch":"main","last_synced_at":"2025-01-28T22:37:35.352Z","etag":null,"topics":["circuitpython","hacktoberfest"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adafruit.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-10-01T14:35:00.000Z","updated_at":"2025-01-16T15:18:11.000Z","dependencies_parsed_at":"2023-02-11T23:45:25.890Z","dependency_job_id":"86e428cc-c59b-4757-b536-354170d3522d","html_url":"https://github.com/adafruit/Adafruit_CircuitPython_OV5640","commit_stats":{"total_commits":96,"total_committers":14,"mean_commits":6.857142857142857,"dds":0.625,"last_synced_commit":"8013c701d44c2e79b21787085be9dd7609d59088"},"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adafruit%2FAdafruit_CircuitPython_OV5640","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adafruit%2FAdafruit_CircuitPython_OV5640/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adafruit%2FAdafruit_CircuitPython_OV5640/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adafruit%2FAdafruit_CircuitPython_OV5640/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adafruit","download_url":"https://codeload.github.com/adafruit/Adafruit_CircuitPython_OV5640/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237181559,"owners_count":19268057,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["circuitpython","hacktoberfest"],"created_at":"2024-09-24T19:59:02.887Z","updated_at":"2025-10-19T17:31:47.749Z","avatar_url":"https://github.com/adafruit.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Introduction\n============\n\n\n.. image:: https://readthedocs.org/projects/adafruit-circuitpython-ov5640/badge/?version=latest\n    :target: https://docs.circuitpython.org/projects/ov5640/en/latest/\n    :alt: Documentation Status\n\n\n.. image:: https://raw.githubusercontent.com/adafruit/Adafruit_CircuitPython_Bundle/main/badges/adafruit_discord.svg\n    :target: https://adafru.it/discord\n    :alt: Discord\n\n\n.. image:: https://github.com/adafruit/Adafruit_CircuitPython_ov5640/workflows/Build%20CI/badge.svg\n    :target: https://github.com/adafruit/Adafruit_CircuitPython_ov5640/actions\n    :alt: Build Status\n\n\n.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json\n    :target: https://github.com/astral-sh/ruff\n    :alt: Code Style: Ruff\n\nCircuitPython driver for OV5640 Camera\n\n\nInstalling to a Connected CircuitPython Device with Circup\n==========================================================\n\nMake sure that you have ``circup`` installed in your Python environment.\nInstall it with the following command if necessary:\n\n.. code-block:: shell\n\n    pip3 install circup\n\nWith ``circup`` installed and your CircuitPython device connected use the\nfollowing command to install:\n\n.. code-block:: shell\n\n    circup install adafruit_ov5640\n\nOr the following command to update an existing version:\n\n.. code-block:: shell\n\n    circup update\n\nUsage Example\n=============\n\n.. code-block: python\n\n    \"\"\"Capture an image from the camera and display it as ASCII art.\n\n    This demo is designed to run on the Kaluga, but you can adapt it\n    to other boards by changing the constructors for `bus` and `cam`\n    appropriately.\n\n    The camera is placed in YUV mode, so the top 8 bits of each color\n    value can be treated as \"greyscale\".\n\n    It's important that you use a terminal program that can interpret\n    \"ANSI\" escape sequences.  The demo uses them to \"paint\" each frame\n    on top of the prevous one, rather than scrolling.\n\n    Remember to take the lens cap off, or un-comment the line setting\n    the test pattern!\n    \"\"\"\n\n    import sys\n    import time\n\n    import busio\n    import board\n\n    import adafruit_ov5640\n\n    print(\"construct bus\")\n    bus = busio.I2C(scl=board.CAMERA_SIOC, sda=board.CAMERA_SIOD)\n    print(\"construct camera\")\n    cam = adafruit_ov5640.OV5640(\n        bus,\n        data_pins=board.CAMERA_DATA,\n        clock=board.CAMERA_PCLK,\n        vsync=board.CAMERA_VSYNC,\n        href=board.CAMERA_HREF,\n        mclk=board.CAMERA_XCLK,\n        size=adafruit_ov5640.OV5640_SIZE_QQVGA,\n    )\n    print(\"print chip id\")\n    print(cam.chip_id)\n\n\n    cam.colorspace = adafruit_ov5640.OV5640_COLOR_YUV\n    cam.flip_y = True\n    cam.flip_x = True\n    cam.test_pattern = False\n\n    buf = bytearray(cam.capture_buffer_size)\n    chars = b\" .':-+=*%$#\"\n    remap = [chars[i * (len(chars) - 1) // 255] for i in range(256)]\n\n    width = cam.width\n    row = bytearray(width)\n\n    print(\"capturing\")\n    cam.capture(buf)\n    print(\"capture complete\")\n\n    sys.stdout.write(\"\\033[2J\")\n    while True:\n        cam.capture(buf)\n        for j in range(0, cam.height, 2):\n            sys.stdout.write(f\"\\033[{j//2}H\")\n            for i in range(cam.width):\n                row[i] = remap[buf[2 * (width * j + i)]]\n            sys.stdout.write(row)\n            sys.stdout.write(\"\\033[K\")\n        sys.stdout.write(\"\\033[J\")\n        time.sleep(0.05)\n\nDocumentation\n=============\n\nAPI documentation for this library can be found on `Read the Docs \u003chttps://docs.circuitpython.org/projects/ov5640/en/latest/\u003e`_.\n\nFor information on building library documentation, please check out\n`this guide \u003chttps://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/sharing-our-docs-on-readthedocs#sphinx-5-1\u003e`_.\n\nContributing\n============\n\nContributions are welcome! Please read our `Code of Conduct\n\u003chttps://github.com/adafruit/Adafruit_CircuitPython_ov5640/blob/HEAD/CODE_OF_CONDUCT.md\u003e`_\nbefore contributing to help this project stay welcoming.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadafruit%2Fadafruit_circuitpython_ov5640","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadafruit%2Fadafruit_circuitpython_ov5640","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadafruit%2Fadafruit_circuitpython_ov5640/lists"}