{"id":15142065,"url":"https://github.com/porplax/neobridge","last_synced_at":"2025-04-05T13:14:07.257Z","repository":{"id":232030020,"uuid":"783275739","full_name":"porplax/neobridge","owner":"porplax","description":"Lets you control neopixels from your PC using a board. Making it easy to implement a more diverse variety of lighting effects!","archived":false,"fork":false,"pushed_at":"2024-06-19T07:21:51.000Z","size":78,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-13T03:49:59.886Z","etag":null,"topics":["circuitpython","neopixels","rp2040","serial-communication"],"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/porplax.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2024-04-07T12:45:44.000Z","updated_at":"2024-06-13T20:51:32.000Z","dependencies_parsed_at":"2025-02-08T21:32:46.542Z","dependency_job_id":"8c3f1e23-4b65-42dc-aff9-16900eca1484","html_url":"https://github.com/porplax/neobridge","commit_stats":null,"previous_names":["porplax/neobridge"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/porplax%2Fneobridge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/porplax%2Fneobridge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/porplax%2Fneobridge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/porplax%2Fneobridge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/porplax","download_url":"https://codeload.github.com/porplax/neobridge/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247339159,"owners_count":20923014,"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":["circuitpython","neopixels","rp2040","serial-communication"],"created_at":"2024-09-26T09:22:16.478Z","updated_at":"2025-04-05T13:14:07.232Z","avatar_url":"https://github.com/porplax.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\r\n  \u003cimg src=\"https://github.com/porplax/neobridge/assets/66521670/23d60ffd-23db-4962-be2c-74dc497fe5ad\"\u003e\r\n\u003c/p\u003e\r\n\r\n--------\r\n\r\n\u003cp align=\"center\"\u003eControl your neopixels from your PC!\u003c/p\u003e\r\n\r\n# Installation\r\n`pip install neobridge`\r\n## Setup (board)\r\nTo start controlling neopixels directly from your PC, you have to setup your circuitpython board to receive serial commands. This is already programmed in the `code.py` script. Follow the steps below.\r\n1. Download [code.py](https://github.com/porplax/neobridge/blob/master/src/neobridge/code.py)\r\n2. Move to the circuitpython board (*RP2040 is officially supported*)\r\n3. **You will need to edit `code.py` to fit your setup!** (*Number of LEDs, Pin location, Order*)\r\n4. Run the script.\r\nThe script will run every bootup.\r\n\r\n## Setup (PC/Linux/MacOS)\r\nNow that the board is ready for serial communication, you can now control it from your PC directly. This lets you program a lot of cool lighting effects! The example below creates a 'loading' bar like effect.\r\n```py\r\nfrom itertools import cycle\r\n\r\nfrom neobridge import Neobridge\r\nimport serial\r\nimport time\r\n\r\nFRAME_RATE = 12 # How many frames per second to run code as.\r\n\r\n# You have to provide the serial object.\r\na = Neobridge(serial.Serial(\r\n            'LOCATION OF BOARD',\r\n            baudrate=115200,\r\n            timeout=0.05,\r\n            write_timeout=1), 30)\r\n\r\na.setall((0, 0, 0)) # Set all LEDs to black (nothing)\r\na.show() # Update to show change!\r\n\r\nc = cycle(range(0, 30))\r\nfor i in c:\r\n    a.setone((255, 255, 255), i) # Set only one at a time.\r\n    a.show()\r\n    \r\n    a.setall((0, 0, 0)) # Reset to black.\r\n    time.sleep(1 / FRAME_RATE)\r\n```\r\nBefore you can start controlling from PC, you have to enter the location of your board.\r\n- On Windows, this is usually under a name such as `COM3`, this can be different.\r\n- On Linux, it looks like `/dev/ttyACM0`\r\n- On MacOS, the name looks like `/dev/tty.usbmodem1d12`\r\n\r\n\r\n**These names can be different!**\r\nMake sure to find the right one for the board!\r\n## Documentation\r\n```py\r\na = Neobridge(ser: serial.Serial, n_of_leds: int)\r\n\"\"\"\r\nArgs:\r\n        `ser (serial.Serial)`: Takes a `serial.Serial` object, this is from **pyserial**\r\n        `n_of_leds (int)`: Number of LEDs on the board.\r\n\"\"\"\r\n```\r\n\r\n```py\r\nneobridge.wait_for_response(self)\r\n\"\"\"\r\n*Sends a command to the board to wait for a response.*\r\n\"\"\"\r\n```\r\n\r\n```py\r\nneobridge.setall(self, rgb: tuple)\r\n\"\"\"\r\n*Sets all LEDs on the board to the given RGB values.*\r\n    Args:\r\n        `rgb (tuple)`: RGB values to set.\r\n\"\"\"\r\n```\r\n\r\n```py\r\nneobridge.setone(self, rgb: tuple, index: int)\r\n\"\"\"\r\n*Sets a single LED on the board to the given RGB values.*\r\n    Args:\r\n        rgb (tuple): RGB values to set.\r\n        index (int): Index of the LED to set.\r\n\"\"\"\r\n```\r\n\r\n```py\r\nneobridge.setlist(self, rgb_list: list)\r\n\"\"\"\r\n*Gives the board a list of RGB values to set.*\r\n    Args:\r\n        rgb (rgb_list): RGB list to set.\r\n\"\"\"\r\n```\r\n\r\n```py\r\nneobridge.show(self)\r\n\"\"\"\r\nSends a command to the board to update the LEDs.\r\n\"\"\"\r\n```\r\n# TO-DO List\r\n- [X] Create automated installer for the board. (could do?)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fporplax%2Fneobridge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fporplax%2Fneobridge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fporplax%2Fneobridge/lists"}