RGBMatrixDriver


NameRGBMatrixDriver JSON
Version 0.1.3 PyPI version JSON
download
home_pageNone
SummaryA driver middleware for LED matrix software compatible with rpi-rgb-led-matrix
upload_time2024-05-24 05:27:00
maintainerNone
docs_urlNone
authorNone
requires_pythonNone
licenseNone
keywords led led matrix rpi matrix raspberry raspberry pi
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # `RGBMatrixDriver`

[![pypi Badge](https://img.shields.io/pypi/v/RGBMatrixDriver)](https://pypi.org/project/RGBMatrixDriver/)

`RGBMatrixDriver` is a driver middleware for `rpi-rgb-led-matrix`/`RGBMatrixEmulator` compatible display scripts.

Write your display script once, then run it on either real hardware or via software emulation. Out of the box, the middleware lets you get off the ground with a sensible default configuration while allowing extensibility and additional features.

## Installation

`RGBMatrixDriver` is in the [Python Package Index (PyPI)](http://pypi.python.org/pypi/RGBMatrixDriver/).
Installing with `pip` is recommended for all systems.

```sh
pip install RGBMatrixDriver
```

## Setup

Projects that are compatible with `RGBMatrixDriver` will rely on importing classes from `rpi-rgb-led-matrix`. These will need to be replaced by equivalent `RGBMatrixDriver` classes.

For example, usage on a Rasberry Pi might look like this:

```python
from rgbmatrix import RGBMatrix, RGBMatrixOptions
```

Using the driver middleware, you will need to use `RGBMatrixDriver` classes:

```python
from RGBMatrixDriver import RGBMatrix, RGBMatrixOptions
```

To take full advantage of the driver middleware, you will need to parse arguments using the `RGBMatrixArguments` class instead of a standard `argparse.ArgumentParser`. You can run this example in `/samples/quick_start.py`.

```python
from random import randint as r
from RGBMatrixDriver import RGBMatrix, RGBMatrixArguments, prefilled_matrix_options


# Support all the defaults that RGBMatrixDriver includes
args = RGBMatrixArguments().parse_args()

# Fill out an RGBMatrixOptions instance with all the arguments
options = prefilled_matrix_options(args)

# Create a matrix and canvas
matrix = RGBMatrix(options=options)
canvas = matrix.CreateFrameCanvas()

# Push the pixels!
while True:
  # Simulate static -- Set R, G, B equal to each other at random
  for y in range(matrix.height):
    for x in range(matrix.width):
      canvas.SetPixel(x, y, *tuple([r(0, 255)] * 3))

  canvas = matrix.SwapOnVSync(canvas)
```

You can also set a driver log level if you want, which is useful if you use any reporting middleware (such as the `--driver-fps=log` flag).

```python
import logging, RGBMatrixDriver


RGBMatrixDriver.logger.setLevel(logging.INFO)
```

## Usage

For the most part, startup of the existing script will be unchanged, unless you want to pass additional driver flags, as listed in the [Flags](#flags) section below.

The driver can handle both hardware and software emulation display modes.

### Hardware Mode

By default the driver tries to load in hardware mode. This is the mode end users will typically want to run as, so there are no additional flags needed to work on Raspberry Pi.

### Software Emulation Mode

If hardware loading fails for any reason, the driver will fallback to software emulation via `RGBMatrixEmulator`. A command line flag `--emulated` can also be used to force emulation.

See [`RGBMatrixEmulator` README](https://github.com/ty-porter/RGBMatrixEmulator/blob/main/README.md) for customization options when running software emulation mode.

## Flags

You can pass the `-h` / `--help` flags at any time to show a list of arguments that your script supports. This will be a default list of arguments provided for `rpi-rgb-led-matrix`, driver flags provided by this library, and finally, any custom flags you have implemented for your own script.

You should reference the [project README](https://github.com/hzeller/rpi-rgb-led-matrix/blob/master/README.md) for `rpi-rgb-led-matrix` library when necessary.

### Driver Flags

```
--driver-fps {log,overlay}
  Calculate FPS and display via selected method: log, overlay
--emulated
  Run the script in software emulation mode via RGBMatrixEmulator
```

## Contributing
If you want to help develop RGBMatrixDriver, you must also install the dev dependencies, which can be done by running `pip install -e .[dev]` from within the directory.

Before submitting a PR, please open an issue to help us track development. All development should be based off of the `dev` branch. This branch is kept up-to-date with `main` after releases. 

## Contact

Tyler Porter

tyler.b.porter@gmail.com

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "RGBMatrixDriver",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "LED, LED matrix, RPI, matrix, raspberry, raspberry pi",
    "author": null,
    "author_email": "Tyler Porter <tyler.b.porter@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/1a/21/a09d286f5d959920910182477bbfa82f2d2de64d53f2bb803105cdf86b00/rgbmatrixdriver-0.1.3.tar.gz",
    "platform": null,
    "description": "# `RGBMatrixDriver`\n\n[![pypi Badge](https://img.shields.io/pypi/v/RGBMatrixDriver)](https://pypi.org/project/RGBMatrixDriver/)\n\n`RGBMatrixDriver` is a driver middleware for `rpi-rgb-led-matrix`/`RGBMatrixEmulator` compatible display scripts.\n\nWrite your display script once, then run it on either real hardware or via software emulation. Out of the box, the middleware lets you get off the ground with a sensible default configuration while allowing extensibility and additional features.\n\n## Installation\n\n`RGBMatrixDriver` is in the [Python Package Index (PyPI)](http://pypi.python.org/pypi/RGBMatrixDriver/).\nInstalling with `pip` is recommended for all systems.\n\n```sh\npip install RGBMatrixDriver\n```\n\n## Setup\n\nProjects that are compatible with `RGBMatrixDriver` will rely on importing classes from `rpi-rgb-led-matrix`. These will need to be replaced by equivalent `RGBMatrixDriver` classes.\n\nFor example, usage on a Rasberry Pi might look like this:\n\n```python\nfrom rgbmatrix import RGBMatrix, RGBMatrixOptions\n```\n\nUsing the driver middleware, you will need to use `RGBMatrixDriver` classes:\n\n```python\nfrom RGBMatrixDriver import RGBMatrix, RGBMatrixOptions\n```\n\nTo take full advantage of the driver middleware, you will need to parse arguments using the `RGBMatrixArguments` class instead of a standard `argparse.ArgumentParser`. You can run this example in `/samples/quick_start.py`.\n\n```python\nfrom random import randint as r\nfrom RGBMatrixDriver import RGBMatrix, RGBMatrixArguments, prefilled_matrix_options\n\n\n# Support all the defaults that RGBMatrixDriver includes\nargs = RGBMatrixArguments().parse_args()\n\n# Fill out an RGBMatrixOptions instance with all the arguments\noptions = prefilled_matrix_options(args)\n\n# Create a matrix and canvas\nmatrix = RGBMatrix(options=options)\ncanvas = matrix.CreateFrameCanvas()\n\n# Push the pixels!\nwhile True:\n  # Simulate static -- Set R, G, B equal to each other at random\n  for y in range(matrix.height):\n    for x in range(matrix.width):\n      canvas.SetPixel(x, y, *tuple([r(0, 255)] * 3))\n\n  canvas = matrix.SwapOnVSync(canvas)\n```\n\nYou can also set a driver log level if you want, which is useful if you use any reporting middleware (such as the `--driver-fps=log` flag).\n\n```python\nimport logging, RGBMatrixDriver\n\n\nRGBMatrixDriver.logger.setLevel(logging.INFO)\n```\n\n## Usage\n\nFor the most part, startup of the existing script will be unchanged, unless you want to pass additional driver flags, as listed in the [Flags](#flags) section below.\n\nThe driver can handle both hardware and software emulation display modes.\n\n### Hardware Mode\n\nBy default the driver tries to load in hardware mode. This is the mode end users will typically want to run as, so there are no additional flags needed to work on Raspberry Pi.\n\n### Software Emulation Mode\n\nIf hardware loading fails for any reason, the driver will fallback to software emulation via `RGBMatrixEmulator`. A command line flag `--emulated` can also be used to force emulation.\n\nSee [`RGBMatrixEmulator` README](https://github.com/ty-porter/RGBMatrixEmulator/blob/main/README.md) for customization options when running software emulation mode.\n\n## Flags\n\nYou can pass the `-h` / `--help` flags at any time to show a list of arguments that your script supports. This will be a default list of arguments provided for `rpi-rgb-led-matrix`, driver flags provided by this library, and finally, any custom flags you have implemented for your own script.\n\nYou should reference the [project README](https://github.com/hzeller/rpi-rgb-led-matrix/blob/master/README.md) for `rpi-rgb-led-matrix` library when necessary.\n\n### Driver Flags\n\n```\n--driver-fps {log,overlay}\n  Calculate FPS and display via selected method: log, overlay\n--emulated\n  Run the script in software emulation mode via RGBMatrixEmulator\n```\n\n## Contributing\nIf you want to help develop RGBMatrixDriver, you must also install the dev dependencies, which can be done by running `pip install -e .[dev]` from within the directory.\n\nBefore submitting a PR, please open an issue to help us track development. All development should be based off of the `dev` branch. This branch is kept up-to-date with `main` after releases. \n\n## Contact\n\nTyler Porter\n\ntyler.b.porter@gmail.com\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A driver middleware for LED matrix software compatible with rpi-rgb-led-matrix",
    "version": "0.1.3",
    "project_urls": {
        "Homepage": "https://github.com/ty-porter/RGBMatrixDriver"
    },
    "split_keywords": [
        "led",
        " led matrix",
        " rpi",
        " matrix",
        " raspberry",
        " raspberry pi"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "106f1f142e9bc0e28f42108892fb73949f1b4c47e9094b46757efa9620deb751",
                "md5": "e5759b0637e2cedea2ebc37c1b5ac436",
                "sha256": "73ef714ee1f870e28f217306bc3139681f5e89cdace1fcb8f34d29ae73d71bfb"
            },
            "downloads": -1,
            "filename": "rgbmatrixdriver-0.1.3-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e5759b0637e2cedea2ebc37c1b5ac436",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 22818,
            "upload_time": "2024-05-24T05:26:59",
            "upload_time_iso_8601": "2024-05-24T05:26:59.286072Z",
            "url": "https://files.pythonhosted.org/packages/10/6f/1f142e9bc0e28f42108892fb73949f1b4c47e9094b46757efa9620deb751/rgbmatrixdriver-0.1.3-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1a21a09d286f5d959920910182477bbfa82f2d2de64d53f2bb803105cdf86b00",
                "md5": "6f325cbabed885eeeea78f910bf621d2",
                "sha256": "cc02af45be5bca57a532816a4400fc5499a4684c08becc5d36caf7cd5d0cc5a7"
            },
            "downloads": -1,
            "filename": "rgbmatrixdriver-0.1.3.tar.gz",
            "has_sig": false,
            "md5_digest": "6f325cbabed885eeeea78f910bf621d2",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 3459,
            "upload_time": "2024-05-24T05:27:00",
            "upload_time_iso_8601": "2024-05-24T05:27:00.500787Z",
            "url": "https://files.pythonhosted.org/packages/1a/21/a09d286f5d959920910182477bbfa82f2d2de64d53f2bb803105cdf86b00/rgbmatrixdriver-0.1.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-24 05:27:00",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ty-porter",
    "github_project": "RGBMatrixDriver",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "rgbmatrixdriver"
}
        
Elapsed time: 0.23612s