circuitpython-gamecontrols


Namecircuitpython-gamecontrols JSON
Version 1.0.1 PyPI version JSON
download
home_pageNone
SummaryAn abstraction layer for CircuitPython to access commonly used video game control inputs in a consistent manner across different hardware devices and configurations.
upload_time2025-01-25 17:33:23
maintainerNone
docs_urlNone
authorNone
requires_pythonNone
licenseMIT
keywords adafruit blinka circuitpython micropython gamecontrols game games controller game-controller konami videogame gameboy game&watch
VCS
bugtrack_url
requirements Adafruit-Blinka adafruit-circuitpython-busdevice adafruit-circuitpython-register
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Introduction
============


.. image:: https://readthedocs.org/projects/circuitpython-gamecontrols/badge/?version=latest
    :target: https://circuitpython-gamecontrols.readthedocs.io/
    :alt: Documentation Status


.. image:: https://img.shields.io/discord/327254708534116352.svg
    :target: https://adafru.it/discord
    :alt: Discord


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


.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json
    :target: https://github.com/astral-sh/ruff
    :alt: Code Style: Ruff

An abstraction layer for CircuitPython to access commonly used video game control inputs in a consistent manner across different hardware devices and configurations.


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

* `Adafruit CircuitPython <https://github.com/adafruit/circuitpython>`_
* `Bus Device <https://github.com/adafruit/Adafruit_CircuitPython_BusDevice>`_
* `Register <https://github.com/adafruit/Adafruit_CircuitPython_Register>`_

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>`_
or individual libraries can be installed using
`circup <https://github.com/adafruit/circup>`_.

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

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

.. code-block:: shell

    pip3 install circuitpython-gamecontrols

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

.. code-block:: shell

    sudo pip3 install circuitpython-gamecontrols

To install in a virtual environment in your current project:

.. code-block:: shell

    mkdir project-name && cd project-name
    python3 -m venv .venv
    source .env/bin/activate
    pip3 install circuitpython-gamecontrols

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 gamecontrols

Or the following command to update an existing version:

.. code-block:: shell

    circup update

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

.. code-block:: python

    from game_controls import game_controls

    while True:
        cur_state = game_controls.button
        if (cur_state['a']):
            print("A btn!")

        if (cur_state['b']):
            print("B btn!")

        if (cur_state['start']):
            print("START btn!")

        if (cur_state['select']):
            print("SELECT btn!")

        if (cur_state['up']):
            print("UP btn!")

        if (cur_state['down']):
            print("DOWN btn!")

        if (cur_state['right']):
            print("RIGHT btn!")

        if (cur_state['left']):
            print("LEFT btn!")

Documentation
=============
API documentation for this library can be found on `Read the Docs <https://circuitpython-gamecontrols.readthedocs.io/>`_.

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/foamyguy/CircuitPython_GameControls/blob/HEAD/CODE_OF_CONDUCT.md>`_
before contributing to help this project stay welcoming.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "circuitpython-gamecontrols",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "adafruit, blinka, circuitpython, micropython, gamecontrols, game, games, controller, game-controller, konami, videogame, gameboy, game&watch",
    "author": null,
    "author_email": "Tim C <foamyguy@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/ab/39/1ea3a75efbbbd3baf6c3cdb98654632e5619cfac0f2da1b2bcf815296db0/circuitpython_gamecontrols-1.0.1.tar.gz",
    "platform": null,
    "description": "Introduction\n============\n\n\n.. image:: https://readthedocs.org/projects/circuitpython-gamecontrols/badge/?version=latest\n    :target: https://circuitpython-gamecontrols.readthedocs.io/\n    :alt: Documentation Status\n\n\n.. image:: https://img.shields.io/discord/327254708534116352.svg\n    :target: https://adafru.it/discord\n    :alt: Discord\n\n\n.. image:: https://github.com/foamyguy/CircuitPython_GameControls/workflows/Build%20CI/badge.svg\n    :target: https://github.com/foamyguy/CircuitPython_GameControls/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\nAn abstraction layer for CircuitPython to access commonly used video game control inputs in a consistent manner across different hardware devices and configurations.\n\n\nDependencies\n=============\nThis driver depends on:\n\n* `Adafruit CircuitPython <https://github.com/adafruit/circuitpython>`_\n* `Bus Device <https://github.com/adafruit/Adafruit_CircuitPython_BusDevice>`_\n* `Register <https://github.com/adafruit/Adafruit_CircuitPython_Register>`_\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>`_\nor individual libraries can be installed using\n`circup <https://github.com/adafruit/circup>`_.\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/circuitpython-gamecontrols/>`_.\nTo install for current user:\n\n.. code-block:: shell\n\n    pip3 install circuitpython-gamecontrols\n\nTo install system-wide (this may be required in some cases):\n\n.. code-block:: shell\n\n    sudo pip3 install circuitpython-gamecontrols\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 .env/bin/activate\n    pip3 install circuitpython-gamecontrols\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 gamecontrols\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    from game_controls import game_controls\n\n    while True:\n        cur_state = game_controls.button\n        if (cur_state['a']):\n            print(\"A btn!\")\n\n        if (cur_state['b']):\n            print(\"B btn!\")\n\n        if (cur_state['start']):\n            print(\"START btn!\")\n\n        if (cur_state['select']):\n            print(\"SELECT btn!\")\n\n        if (cur_state['up']):\n            print(\"UP btn!\")\n\n        if (cur_state['down']):\n            print(\"DOWN btn!\")\n\n        if (cur_state['right']):\n            print(\"RIGHT btn!\")\n\n        if (cur_state['left']):\n            print(\"LEFT btn!\")\n\nDocumentation\n=============\nAPI documentation for this library can be found on `Read the Docs <https://circuitpython-gamecontrols.readthedocs.io/>`_.\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/foamyguy/CircuitPython_GameControls/blob/HEAD/CODE_OF_CONDUCT.md>`_\nbefore contributing to help this project stay welcoming.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "An abstraction layer for CircuitPython to access commonly used video game control inputs in a consistent manner across different hardware devices and configurations.",
    "version": "1.0.1",
    "project_urls": {
        "Homepage": "https://github.com/foamyguy/CircuitPython_GameControls"
    },
    "split_keywords": [
        "adafruit",
        " blinka",
        " circuitpython",
        " micropython",
        " gamecontrols",
        " game",
        " games",
        " controller",
        " game-controller",
        " konami",
        " videogame",
        " gameboy",
        " game&watch"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "3e67ca42c0e8614d2aefef9b081043902ebd954e97b8743149cee002e36e6073",
                "md5": "0cfb7e5bda25c00a2248e33388062d9a",
                "sha256": "89ee156534548b6c0d8916420e3dfee5f380b2c5193e83a25a5ff1361ab23505"
            },
            "downloads": -1,
            "filename": "circuitpython_gamecontrols-1.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0cfb7e5bda25c00a2248e33388062d9a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 10598,
            "upload_time": "2025-01-25T17:33:20",
            "upload_time_iso_8601": "2025-01-25T17:33:20.590268Z",
            "url": "https://files.pythonhosted.org/packages/3e/67/ca42c0e8614d2aefef9b081043902ebd954e97b8743149cee002e36e6073/circuitpython_gamecontrols-1.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "ab391ea3a75efbbbd3baf6c3cdb98654632e5619cfac0f2da1b2bcf815296db0",
                "md5": "3eea6673d6fea32939278adffcd6be39",
                "sha256": "2e6e2a61b8cbd91bb0bd476b60896c34c9c5d79aeb8d3992c27badd02089dfaf"
            },
            "downloads": -1,
            "filename": "circuitpython_gamecontrols-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "3eea6673d6fea32939278adffcd6be39",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 24990,
            "upload_time": "2025-01-25T17:33:23",
            "upload_time_iso_8601": "2025-01-25T17:33:23.403037Z",
            "url": "https://files.pythonhosted.org/packages/ab/39/1ea3a75efbbbd3baf6c3cdb98654632e5619cfac0f2da1b2bcf815296db0/circuitpython_gamecontrols-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-25 17:33:23",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "foamyguy",
    "github_project": "CircuitPython_GameControls",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "Adafruit-Blinka",
            "specs": []
        },
        {
            "name": "adafruit-circuitpython-busdevice",
            "specs": []
        },
        {
            "name": "adafruit-circuitpython-register",
            "specs": []
        }
    ],
    "lcname": "circuitpython-gamecontrols"
}
        
Elapsed time: 8.36194s