adafruit-circuitpython-ov5640


Nameadafruit-circuitpython-ov5640 JSON
Version 1.2.0 PyPI version JSON
download
home_pageNone
SummaryCircuitPython driver for OV5640 Camera
upload_time2024-05-29 16:04:21
maintainerNone
docs_urlNone
authorNone
requires_pythonNone
licenseMIT
keywords adafruit ov5640 camera breakout hardware micropythoncircuitpython
VCS
bugtrack_url
requirements Adafruit-Blinka adafruit-circuitpython-busdevice
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Introduction
============


.. image:: https://readthedocs.org/projects/adafruit-circuitpython-ov5640/badge/?version=latest
    :target: https://docs.circuitpython.org/projects/ov5640/en/latest/
    :alt: Documentation Status


.. image:: https://raw.githubusercontent.com/adafruit/Adafruit_CircuitPython_Bundle/main/badges/adafruit_discord.svg
    :target: https://adafru.it/discord
    :alt: Discord


.. image:: https://github.com/adafruit/Adafruit_CircuitPython_ov5640/workflows/Build%20CI/badge.svg
    :target: https://github.com/adafruit/Adafruit_CircuitPython_ov5640/actions
    :alt: Build Status


.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
    :target: https://github.com/psf/black
    :alt: Code Style: Black

CircuitPython driver for OV5640 Camera


Installing to a Connected CircuitPython Device with Circup
==========================================================

Make sure that you have ``circup`` installed in your Python environment.
Install it with the following command if necessary:

.. code-block:: shell

    pip3 install circup

With ``circup`` installed and your CircuitPython device connected use the
following command to install:

.. code-block:: shell

    circup install adafruit_ov5640

Or the following command to update an existing version:

.. code-block:: shell

    circup update

Usage Example
=============

.. code-block: python

    """Capture an image from the camera and display it as ASCII art.

    This demo is designed to run on the Kaluga, but you can adapt it
    to other boards by changing the constructors for `bus` and `cam`
    appropriately.

    The camera is placed in YUV mode, so the top 8 bits of each color
    value can be treated as "greyscale".

    It's important that you use a terminal program that can interpret
    "ANSI" escape sequences.  The demo uses them to "paint" each frame
    on top of the prevous one, rather than scrolling.

    Remember to take the lens cap off, or un-comment the line setting
    the test pattern!
    """

    import sys
    import time

    import busio
    import board

    import adafruit_ov5640

    print("construct bus")
    bus = busio.I2C(scl=board.CAMERA_SIOC, sda=board.CAMERA_SIOD)
    print("construct camera")
    cam = adafruit_ov5640.OV5640(
        bus,
        data_pins=board.CAMERA_DATA,
        clock=board.CAMERA_PCLK,
        vsync=board.CAMERA_VSYNC,
        href=board.CAMERA_HREF,
        mclk=board.CAMERA_XCLK,
        size=adafruit_ov5640.OV5640_SIZE_QQVGA,
    )
    print("print chip id")
    print(cam.chip_id)


    cam.colorspace = adafruit_ov5640.OV5640_COLOR_YUV
    cam.flip_y = True
    cam.flip_x = True
    cam.test_pattern = False

    buf = bytearray(cam.capture_buffer_size)
    chars = b" .':-+=*%$#"
    remap = [chars[i * (len(chars) - 1) // 255] for i in range(256)]

    width = cam.width
    row = bytearray(width)

    print("capturing")
    cam.capture(buf)
    print("capture complete")

    sys.stdout.write("\033[2J")
    while True:
        cam.capture(buf)
        for j in range(0, cam.height, 2):
            sys.stdout.write(f"\033[{j//2}H")
            for i in range(cam.width):
                row[i] = remap[buf[2 * (width * j + i)]]
            sys.stdout.write(row)
            sys.stdout.write("\033[K")
        sys.stdout.write("\033[J")
        time.sleep(0.05)

Documentation
=============

API documentation for this library can be found on `Read the Docs <https://docs.circuitpython.org/projects/ov5640/en/latest/>`_.

For information on building library documentation, please check out
`this guide <https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/sharing-our-docs-on-readthedocs#sphinx-5-1>`_.

Contributing
============

Contributions are welcome! Please read our `Code of Conduct
<https://github.com/adafruit/Adafruit_CircuitPython_ov5640/blob/HEAD/CODE_OF_CONDUCT.md>`_
before contributing to help this project stay welcoming.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "adafruit-circuitpython-ov5640",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "adafruit, ov5640, camera, breakout, hardware, micropythoncircuitpython",
    "author": null,
    "author_email": "Adafruit Industries <circuitpython@adafruit.com>",
    "download_url": "https://files.pythonhosted.org/packages/2c/59/296b7ff58e595ed4c06f7736e512cfe1e74c808e299ff2bb3c2f9d1957cc/adafruit_circuitpython_ov5640-1.2.0.tar.gz",
    "platform": null,
    "description": "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/badge/code%20style-black-000000.svg\n    :target: https://github.com/psf/black\n    :alt: Code Style: Black\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 <https://docs.circuitpython.org/projects/ov5640/en/latest/>`_.\n\nFor information on building library documentation, please check out\n`this guide <https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/sharing-our-docs-on-readthedocs#sphinx-5-1>`_.\n\nContributing\n============\n\nContributions are welcome! Please read our `Code of Conduct\n<https://github.com/adafruit/Adafruit_CircuitPython_ov5640/blob/HEAD/CODE_OF_CONDUCT.md>`_\nbefore contributing to help this project stay welcoming.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "CircuitPython driver for OV5640 Camera",
    "version": "1.2.0",
    "project_urls": {
        "Homepage": "https://github.com/adafruit/Adafruit_CircuitPython_OV5640"
    },
    "split_keywords": [
        "adafruit",
        " ov5640",
        " camera",
        " breakout",
        " hardware",
        " micropythoncircuitpython"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "aad91a3d31baaf59092bb93a7fee505f5c7941c60268d2e7a0d630b923c5c889",
                "md5": "e881903e3b264899231d97fc4a7af591",
                "sha256": "2d15ba565c21148098aede6ccf8dadc449b5c34a727f65dab0c448112a6f4200"
            },
            "downloads": -1,
            "filename": "adafruit_circuitpython_ov5640-1.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e881903e3b264899231d97fc4a7af591",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 18880,
            "upload_time": "2024-05-29T16:04:19",
            "upload_time_iso_8601": "2024-05-29T16:04:19.601450Z",
            "url": "https://files.pythonhosted.org/packages/aa/d9/1a3d31baaf59092bb93a7fee505f5c7941c60268d2e7a0d630b923c5c889/adafruit_circuitpython_ov5640-1.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2c59296b7ff58e595ed4c06f7736e512cfe1e74c808e299ff2bb3c2f9d1957cc",
                "md5": "9c4b1152097d244ffd3961d94ed05931",
                "sha256": "180791d013d5b27d361ea5cf6b912843558198a7098c9ce5683a8805d6cd629a"
            },
            "downloads": -1,
            "filename": "adafruit_circuitpython_ov5640-1.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "9c4b1152097d244ffd3961d94ed05931",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 55210,
            "upload_time": "2024-05-29T16:04:21",
            "upload_time_iso_8601": "2024-05-29T16:04:21.373643Z",
            "url": "https://files.pythonhosted.org/packages/2c/59/296b7ff58e595ed4c06f7736e512cfe1e74c808e299ff2bb3c2f9d1957cc/adafruit_circuitpython_ov5640-1.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-29 16:04:21",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "adafruit",
    "github_project": "Adafruit_CircuitPython_OV5640",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "Adafruit-Blinka",
            "specs": []
        },
        {
            "name": "adafruit-circuitpython-busdevice",
            "specs": []
        }
    ],
    "lcname": "adafruit-circuitpython-ov5640"
}
        
Elapsed time: 0.28838s