adafruit-circuitpython-displayio-ssd1305


Nameadafruit-circuitpython-displayio-ssd1305 JSON
Version 1.4.0 PyPI version JSON
download
home_page
SummaryDisplayIO driver for SSD1305 monochrome displays
upload_time2023-11-06 23:30:28
maintainer
docs_urlNone
author
requires_python
licenseMIT
keywords adafruit blinka circuitpython micropython displayio_ssd1305 displayio ssd1305 oled
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Introduction
============

.. image:: https://readthedocs.org/projects/adafruit-circuitpython-displayio_ssd1305/badge/?version=latest
    :target: https://docs.circuitpython.org/projects/displayio_ssd1305/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_DisplayIO_SSD1305/workflows/Build%20CI/badge.svg
    :target: https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_SSD1305/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

DisplayIO driver for SSD1305 monochrome displays

For the framebuf based driver see `Adafruit CircuitPython SSD1305 <https://github.com/adafruit/Adafruit_CircuitPython_SSD1305/>`_.


Dependencies
=============
This driver depends on:

* `Adafruit CircuitPython Version 5+ <https://github.com/adafruit/circuitpython>`_

Please ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloading
`the Adafruit library and driver bundle <https://circuitpython.org/libraries>`_.

Installing from PyPI
=====================

On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from
PyPI <https://pypi.org/project/adafruit-circuitpython-displayio_ssd1305/>`_. To install for current user:

.. code-block:: shell

    pip3 install adafruit-circuitpython-displayio-ssd1305

To install system-wide (this may be required in some cases):

.. code-block:: shell

    sudo pip3 install adafruit-circuitpython-displayio-ssd1305

To install in a virtual environment in your current project:

.. code-block:: shell

    mkdir project-name && cd project-name
    python3 -m venv .venv
    source .venv/bin/activate
    pip3 install adafruit-circuitpython-displayio-ssd1305

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

.. code-block:: python

    import board
    import displayio
    # Starting in CircuitPython 9.x fourwire will be a seperate internal library
    # rather than a component of the displayio library
    try:
        from fourwire import FourWire
    # Use for I2C
    #    from i2cdisplaybus import I2CDisplayBus
    except ImportError:
        from displayio import FourWire
        # from displayio import I2CDisplay as I2CDisplayBus
    import terminalio
    from adafruit_display_text import label
    import adafruit_displayio_ssd1305

    displayio.release_displays()

    # Use for SPI
    spi = board.SPI()
    oled_cs = board.D5
    oled_dc = board.D6
    display_bus = FourWire(
        spi, command=oled_dc, chip_select=oled_cs, baudrate=1000000, reset=board.D9
    )

    # Use for I2C
    # i2c = board.I2C()
    #
    # display_bus = I2CDisplayBus(i1c, device_address=0x3c)

    WIDTH = 128
    HEIGHT = 64     # Change to 32 if needed
    BORDER = 8
    FONTSCALE = 1

    display = adafruit_displayio_ssd1305.SSD1305(display_bus, width=WIDTH, height=HEIGHT)

    # Make the display context
    splash = displayio.Group()
    display.root_group = splash

    color_bitmap = displayio.Bitmap(display.width, display.height, 1)
    color_palette = displayio.Palette(1)
    color_palette[0] = 0xFFFFFF # White

    bg_sprite = displayio.TileGrid(color_bitmap,
                                   pixel_shader=color_palette,
                                   x=0, y=0)
    splash.append(bg_sprite)

    # Draw a smaller inner rectangle
    inner_bitmap = displayio.Bitmap(display.width - BORDER * 2, display.height - BORDER * 2, 1)
    inner_palette = displayio.Palette(1)
    inner_palette[0] = 0x000000 # Black
    inner_sprite = displayio.TileGrid(inner_bitmap,
                                      pixel_shader=inner_palette,
                                      x=BORDER, y=BORDER)
    splash.append(inner_sprite)

    # Draw a label
    text = "Hello World!"
    text_area = label.Label(terminalio.FONT, text=text, color=0xFFFFFF)
    text_width = text_area.bounding_box[2] * FONTSCALE
    text_group = displayio.Group(scale=FONTSCALE, x=display.width // 2 - text_width // 2,
                                 y=display.height // 2)
    text_group.append(text_area) # Subgroup for text scaling
    splash.append(text_group)

    while True:
        pass

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

API documentation for this library can be found on `Read the Docs <https://docs.circuitpython.org/projects/displayio_ssd1305/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_DisplayIO_SSD1305/blob/main/CODE_OF_CONDUCT.md>`_
before contributing to help this project stay welcoming.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "adafruit-circuitpython-displayio-ssd1305",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "adafruit,blinka,circuitpython,micropython,displayio_ssd1305,displayio,ssd1305,oled",
    "author": "",
    "author_email": "Adafruit Industries <circuitpython@adafruit.com>",
    "download_url": "https://files.pythonhosted.org/packages/4c/21/a52fc3749461f7e3f55c7bf21e89cec0d5de4b23e1311f91ea01d9071b9c/adafruit-circuitpython-displayio-ssd1305-1.4.0.tar.gz",
    "platform": null,
    "description": "Introduction\n============\n\n.. image:: https://readthedocs.org/projects/adafruit-circuitpython-displayio_ssd1305/badge/?version=latest\n    :target: https://docs.circuitpython.org/projects/displayio_ssd1305/en/latest/\n    :alt: Documentation Status\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.. image:: https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_SSD1305/workflows/Build%20CI/badge.svg\n    :target: https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_SSD1305/actions\n    :alt: Build Status\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\nDisplayIO driver for SSD1305 monochrome displays\n\nFor the framebuf based driver see `Adafruit CircuitPython SSD1305 <https://github.com/adafruit/Adafruit_CircuitPython_SSD1305/>`_.\n\n\nDependencies\n=============\nThis driver depends on:\n\n* `Adafruit CircuitPython Version 5+ <https://github.com/adafruit/circuitpython>`_\n\nPlease ensure all dependencies are available on the CircuitPython filesystem.\nThis is easily achieved by downloading\n`the Adafruit library and driver bundle <https://circuitpython.org/libraries>`_.\n\nInstalling from PyPI\n=====================\n\nOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from\nPyPI <https://pypi.org/project/adafruit-circuitpython-displayio_ssd1305/>`_. To install for current user:\n\n.. code-block:: shell\n\n    pip3 install adafruit-circuitpython-displayio-ssd1305\n\nTo install system-wide (this may be required in some cases):\n\n.. code-block:: shell\n\n    sudo pip3 install adafruit-circuitpython-displayio-ssd1305\n\nTo install in a virtual environment in your current project:\n\n.. code-block:: shell\n\n    mkdir project-name && cd project-name\n    python3 -m venv .venv\n    source .venv/bin/activate\n    pip3 install adafruit-circuitpython-displayio-ssd1305\n\nUsage Example\n=============\n\n.. code-block:: python\n\n    import board\n    import displayio\n    # Starting in CircuitPython 9.x fourwire will be a seperate internal library\n    # rather than a component of the displayio library\n    try:\n        from fourwire import FourWire\n    # Use for I2C\n    #    from i2cdisplaybus import I2CDisplayBus\n    except ImportError:\n        from displayio import FourWire\n        # from displayio import I2CDisplay as I2CDisplayBus\n    import terminalio\n    from adafruit_display_text import label\n    import adafruit_displayio_ssd1305\n\n    displayio.release_displays()\n\n    # Use for SPI\n    spi = board.SPI()\n    oled_cs = board.D5\n    oled_dc = board.D6\n    display_bus = FourWire(\n        spi, command=oled_dc, chip_select=oled_cs, baudrate=1000000, reset=board.D9\n    )\n\n    # Use for I2C\n    # i2c = board.I2C()\n    #\n    # display_bus = I2CDisplayBus(i1c, device_address=0x3c)\n\n    WIDTH = 128\n    HEIGHT = 64     # Change to 32 if needed\n    BORDER = 8\n    FONTSCALE = 1\n\n    display = adafruit_displayio_ssd1305.SSD1305(display_bus, width=WIDTH, height=HEIGHT)\n\n    # Make the display context\n    splash = displayio.Group()\n    display.root_group = splash\n\n    color_bitmap = displayio.Bitmap(display.width, display.height, 1)\n    color_palette = displayio.Palette(1)\n    color_palette[0] = 0xFFFFFF # White\n\n    bg_sprite = displayio.TileGrid(color_bitmap,\n                                   pixel_shader=color_palette,\n                                   x=0, y=0)\n    splash.append(bg_sprite)\n\n    # Draw a smaller inner rectangle\n    inner_bitmap = displayio.Bitmap(display.width - BORDER * 2, display.height - BORDER * 2, 1)\n    inner_palette = displayio.Palette(1)\n    inner_palette[0] = 0x000000 # Black\n    inner_sprite = displayio.TileGrid(inner_bitmap,\n                                      pixel_shader=inner_palette,\n                                      x=BORDER, y=BORDER)\n    splash.append(inner_sprite)\n\n    # Draw a label\n    text = \"Hello World!\"\n    text_area = label.Label(terminalio.FONT, text=text, color=0xFFFFFF)\n    text_width = text_area.bounding_box[2] * FONTSCALE\n    text_group = displayio.Group(scale=FONTSCALE, x=display.width // 2 - text_width // 2,\n                                 y=display.height // 2)\n    text_group.append(text_area) # Subgroup for text scaling\n    splash.append(text_group)\n\n    while True:\n        pass\n\nDocumentation\n=============\n\nAPI documentation for this library can be found on `Read the Docs <https://docs.circuitpython.org/projects/displayio_ssd1305/en/latest/>`_.\n\nFor 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>`_.\n\nContributing\n============\n\nContributions are welcome! Please read our `Code of Conduct\n<https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_SSD1305/blob/main/CODE_OF_CONDUCT.md>`_\nbefore contributing to help this project stay welcoming.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "DisplayIO driver for SSD1305 monochrome displays",
    "version": "1.4.0",
    "project_urls": {
        "Homepage": "https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_SSD1305"
    },
    "split_keywords": [
        "adafruit",
        "blinka",
        "circuitpython",
        "micropython",
        "displayio_ssd1305",
        "displayio",
        "ssd1305",
        "oled"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e457581ebc27f48d3276d12c7f783e0f96e77d90a2e0012271fdcf3b1de3605b",
                "md5": "7b881614ec7a7581c04934ece81b7202",
                "sha256": "5462187366ce87797e00737da825701c7d14099ca8f9300af50f55835be28b55"
            },
            "downloads": -1,
            "filename": "adafruit_circuitpython_displayio_ssd1305-1.4.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7b881614ec7a7581c04934ece81b7202",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 5942,
            "upload_time": "2023-11-06T23:30:26",
            "upload_time_iso_8601": "2023-11-06T23:30:26.920090Z",
            "url": "https://files.pythonhosted.org/packages/e4/57/581ebc27f48d3276d12c7f783e0f96e77d90a2e0012271fdcf3b1de3605b/adafruit_circuitpython_displayio_ssd1305-1.4.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4c21a52fc3749461f7e3f55c7bf21e89cec0d5de4b23e1311f91ea01d9071b9c",
                "md5": "6b46829bee33728dcdf2fd31c2353b61",
                "sha256": "cdd6cc49ba4e7641b921a1ed7e8c7c703e98e8e4bc5598adb7149f40a097954a"
            },
            "downloads": -1,
            "filename": "adafruit-circuitpython-displayio-ssd1305-1.4.0.tar.gz",
            "has_sig": false,
            "md5_digest": "6b46829bee33728dcdf2fd31c2353b61",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 27592,
            "upload_time": "2023-11-06T23:30:28",
            "upload_time_iso_8601": "2023-11-06T23:30:28.684446Z",
            "url": "https://files.pythonhosted.org/packages/4c/21/a52fc3749461f7e3f55c7bf21e89cec0d5de4b23e1311f91ea01d9071b9c/adafruit-circuitpython-displayio-ssd1305-1.4.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-06 23:30:28",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "adafruit",
    "github_project": "Adafruit_CircuitPython_DisplayIO_SSD1305",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "adafruit-circuitpython-displayio-ssd1305"
}
        
Elapsed time: 0.14233s