{"id":13782065,"url":"https://github.com/tino/pyFirmata","last_synced_at":"2025-05-11T15:32:10.110Z","repository":{"id":4233852,"uuid":"5357372","full_name":"tino/pyFirmata","owner":"tino","description":"Python interface for the Firmata (http://firmata.org/) protocol. It is compliant with Firmata 2.1. Any help with updating to 2.2 is welcome. The Capability Query is implemented, but the Pin State Query feature not yet.","archived":false,"fork":false,"pushed_at":"2024-06-06T10:40:30.000Z","size":162,"stargazers_count":583,"open_issues_count":65,"forks_count":193,"subscribers_count":40,"default_branch":"master","last_synced_at":"2025-04-18T21:26:23.832Z","etag":null,"topics":[],"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/tino.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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":"2012-08-09T15:31:33.000Z","updated_at":"2025-04-11T08:41:15.000Z","dependencies_parsed_at":"2024-06-18T14:02:22.339Z","dependency_job_id":null,"html_url":"https://github.com/tino/pyFirmata","commit_stats":{"total_commits":148,"total_committers":14,"mean_commits":"10.571428571428571","dds":0.2364864864864865,"last_synced_commit":"8de0d3257cd41d7cb363e104b840f8a9bc89bcdb"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tino%2FpyFirmata","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tino%2FpyFirmata/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tino%2FpyFirmata/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tino%2FpyFirmata/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tino","download_url":"https://codeload.github.com/tino/pyFirmata/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253588638,"owners_count":21932291,"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":[],"created_at":"2024-08-03T18:01:32.486Z","updated_at":"2025-05-11T15:32:09.728Z","avatar_url":"https://github.com/tino.png","language":"Python","funding_links":[],"categories":["Libraries"],"sub_categories":[],"readme":"=========\npyFirmata\n=========\n\npyFirmata is a Python interface for the `Firmata`_ protocol. It is fully\ncompatible with Firmata 2.1, and has some functionality of version 2.2. It runs\non Python 2.7, 3.6 and 3.7.\n\n.. _Firmata: http://firmata.org\n\nTest \u0026 coverage status:\n\n.. image:: https://travis-ci.org/tino/pyFirmata.png?branch=master\n    :target: https://travis-ci.org/tino/pyFirmata\n\n.. image:: https://coveralls.io/repos/github/tino/pyFirmata/badge.svg?branch=master\n    :target: https://coveralls.io/github/tino/pyFirmata?branch=master\n\nInstallation\n============\n\nThe preferred way to install is with pip_::\n\n    pip install pyfirmata\n\nYou can also install from source with ``python setup.py install``. You will\nneed to have `setuptools`_ installed::\n\n    git clone https://github.com/tino/pyFirmata\n    cd pyFirmata\n    python setup.py install\n\n.. _pip: http://www.pip-installer.org/en/latest/\n.. _setuptools: https://pypi.python.org/pypi/setuptools\n\n\nUsage\n=====\n\nBasic usage::\n\n    \u003e\u003e\u003e from pyfirmata import Arduino, util\n    \u003e\u003e\u003e board = Arduino('/dev/tty.usbserial-A6008rIF')\n    \u003e\u003e\u003e board.digital[13].write(1)\n\nTo use analog ports, it is probably handy to start an iterator thread.\nOtherwise the board will keep sending data to your serial, until it overflows::\n\n    \u003e\u003e\u003e it = util.Iterator(board)\n    \u003e\u003e\u003e it.start()\n    \u003e\u003e\u003e board.analog[0].enable_reporting()\n    \u003e\u003e\u003e board.analog[0].read()\n    0.661440304938\n\nIf you use a pin more often, it can be worth it to use the ``get_pin`` method\nof the board. It let's you specify what pin you need by a string, composed of\n'a' or 'd' (depending on wether you need an analog or digital pin), the pin\nnumber, and the mode ('i' for input, 'o' for output, 'p' for pwm). All\nseperated by ``:``. Eg. ``a:0:i`` for analog 0 as input or ``d:3:p`` for\ndigital pin 3 as pwm.::\n\n    \u003e\u003e\u003e analog_0 = board.get_pin('a:0:i')\n    \u003e\u003e\u003e analog_0.read()\n    0.661440304938\n    \u003e\u003e\u003e pin3 = board.get_pin('d:3:p')\n    \u003e\u003e\u003e pin3.write(0.6)\n\nBoard layout\n============\n\nIf you want to use a board with a different layout than the standard Arduino\nor the Arduino Mega (for which there exist the shortcut classes\n``pyfirmata.Arduino`` and ``pyfirmata.ArduinoMega``), instantiate the Board\nclass with a dictionary as the ``layout`` argument. This is the layout dict\nfor the Mega for example::\n\n    \u003e\u003e\u003e mega = {\n    ...         'digital' : tuple(x for x in range(54)),\n    ...         'analog' : tuple(x for x in range(16)),\n    ...         'pwm' : tuple(x for x in range(2,14)),\n    ...         'use_ports' : True,\n    ...         'disabled' : (0, 1, 14, 15) # Rx, Tx, Crystal\n    ...         }\n\nTodo\n====\n\nThe next things on my list are to implement the new protocol changes in\nfirmata:\n\n- Pin State Query, which allows it to populate on-screen controls with an\n  accurate representation of the hardware's configuration\n  (http://firmata.org/wiki/Proposals#Pin_State_Query_.28added_in_version_2.2.29)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftino%2FpyFirmata","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftino%2FpyFirmata","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftino%2FpyFirmata/lists"}