{"id":15161670,"url":"https://github.com/ollipal/firmatazero","last_synced_at":"2026-01-21T14:02:51.457Z","repository":{"id":61350668,"uuid":"550825832","full_name":"ollipal/firmatazero","owner":"ollipal","description":"GPIO Zero for Arduino, using Firmata protocol","archived":false,"fork":false,"pushed_at":"2022-10-24T12:58:12.000Z","size":89,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-29T23:16:44.214Z","etag":null,"topics":["arduino","firmata","gpiozero","python"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/firmatazero/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ollipal.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-10-13T11:46:21.000Z","updated_at":"2022-10-13T12:59:26.000Z","dependencies_parsed_at":"2023-01-20T10:16:54.350Z","dependency_job_id":null,"html_url":"https://github.com/ollipal/firmatazero","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/ollipal/firmatazero","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ollipal%2Ffirmatazero","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ollipal%2Ffirmatazero/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ollipal%2Ffirmatazero/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ollipal%2Ffirmatazero/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ollipal","download_url":"https://codeload.github.com/ollipal/firmatazero/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ollipal%2Ffirmatazero/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28634786,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T04:47:28.174Z","status":"ssl_error","status_checked_at":"2026-01-21T04:47:22.943Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["arduino","firmata","gpiozero","python"],"created_at":"2024-09-27T00:42:44.836Z","updated_at":"2026-01-21T14:02:51.428Z","avatar_url":"https://github.com/ollipal.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# firmatazero [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\r\n\r\nThe simplest Python interface for controlling pins on Arduino by using [Firmata](https://github.com/firmata/protocol) protocol.\r\n\r\nThis project aims to bring [GPIO Zero](https://github.com/gpiozero/gpiozero)'s excellent Python interface from Raspberry Pi's to Arduinos, while making only minor adjustments that make sense in due to different hardware. This means that in some cases **existing gpiozero code can work on Arduino by simply changing imports and pin numbers**.\r\n\r\nFirmatazero automatically detects Arduino's port and on default expects Arduino Uno, and is thread safe.\r\n\r\nBlink example:\r\n\r\n```python\r\nfrom firmatazero import LED\r\nfrom time import sleep\r\n\r\nled = LED(13) # 13 == LED_BUILTIN\r\n\r\nwhile True:\r\n    led.on()\r\n    sleep(1)\r\n    led.off()\r\n    sleep(1)\r\n```\r\n\r\nServo example:\r\n\r\n```python\r\nfrom firmatazero import Servo\r\nfrom time import sleep\r\n\r\nservo = Servo(9)\r\nwhile True:\r\n    servo.min()\r\n    sleep(1)\r\n    servo.mid()\r\n    sleep(1)\r\n    servo.max()\r\n    sleep(1)\r\n```\r\n\r\nNeedless to say, this project is heavily inspired by [GPIO Zero](https://github.com/gpiozero/gpiozero). This means that the project structure and docstrings are very related, even if the underlying code is different.\r\n\r\nThis project is build with [pyFirmata2](https://github.com/berndporr/pyFirmata2) and [pySerial](https://github.com/pyserial/pyserial) libraries.\r\n\r\nCurrently has very limited amount of devices. Used in [botafar.com](https://botafar.com/) for making shareable, realtime global remote controls possible for robotics projects.\r\n\r\n## Installation\r\n\r\nPython side:\r\n\r\n```\r\npip install firmatazero --upgrade\r\n```\r\n\r\nArduino side: on Arduino IDE select `File \u003e Examples \u003e Firmata \u003e StandardFirmata`.\r\n\r\n![](firmata_ide.png)\r\n\r\nThen select your board and port from `Tools \u003e Board` and `Tools \u003e Port`. Then press `Upload`.\r\n\r\n## Supported devices\r\n\r\nYou can use GPIO Zero's docs, if you take changes intpo account:\r\n\r\n### DigitalOutputDevice\r\n\r\nSame as GPIO Zero's [LED](https://gpiozero.readthedocs.io/en/stable/api_output.html?highlight=OutputDevice#digitaloutputdevice), except:\r\n\r\n- `blink()` not implemented\r\n- `pin_factory` does not have an effect\r\n\r\n### LED\r\n\r\nSame as GPIO Zero's [LED](https://gpiozero.readthedocs.io/en/stable/api_output.html?highlight=Servo#gpiozero.LED), except: \r\n\r\n- `pin` parameter has a default value of 13, the buildin LED\r\n- `blink()` function and `active_high` parameter not implemented\r\n- `pin_factory` does not have an effect\r\n\r\n### Servo\r\n\r\nSame as GPIO Zero's [Servo](https://gpiozero.readthedocs.io/en/stable/api_output.html?highlight=Servo#gpiozero.Servo), except: \r\n\r\n- `pin` parameter has a default value of 9, the pin used in [Knob and Sweep examples](https://docs.arduino.cc/learn/electronics/servo-motors)\r\n- `min_pulse_width` and `max_pulse_width` have default values from [Arduino Servo.h](https://github.com/arduino-libraries/Servo/blob/master/src/Servo.h#L82) library, this means that most hobby servos move 180 degrees out of the box\r\n- `detach()` function not implemented, so `Servo.value = None` is not allowed\r\n- `pin_factory` does not have an effect\r\n\r\n## New functions\r\n\r\n- **detect_port()** detects and returns the first Arduino port it finds, or raises RuntimeError\r\n- **set_port(port)** allows skipping port autodetection, for example: `set_port(\"COM1\")`\r\n- **set_board(board)** allows setting another pyFirmata2 board or settings compared to the default one, for example: `set_board(pyFirmata2.ArduinoMega(\"COM4\"))`\r\n- **get_board** get pyFirmata2 board shared with all devices, to run some custom code with\r\n\r\n# Contributing\r\n\r\nContributions are very welcome. Anything that makes this project to support more GPIO Zero's Devices are very welcome.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Follipal%2Ffirmatazero","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Follipal%2Ffirmatazero","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Follipal%2Ffirmatazero/lists"}