{"id":17841900,"url":"https://github.com/iotpanic/pixels","last_synced_at":"2025-03-20T02:30:54.482Z","repository":{"id":88952933,"uuid":"208515009","full_name":"IoTPanic/pixels","owner":"IoTPanic","description":"Simple library for controlling LED chains","archived":false,"fork":false,"pushed_at":"2020-08-14T23:06:01.000Z","size":35,"stargazers_count":6,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-11T04:42:56.990Z","etag":null,"topics":["arduino-library","esp32","esp8266","led-controlling","led-matrix","led-strips","platformio"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/IoTPanic.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":"2019-09-14T23:11:37.000Z","updated_at":"2025-02-10T07:17:13.000Z","dependencies_parsed_at":"2023-06-13T07:30:27.491Z","dependency_job_id":null,"html_url":"https://github.com/IoTPanic/pixels","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IoTPanic%2Fpixels","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IoTPanic%2Fpixels/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IoTPanic%2Fpixels/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IoTPanic%2Fpixels/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IoTPanic","download_url":"https://codeload.github.com/IoTPanic/pixels/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244538553,"owners_count":20468734,"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":["arduino-library","esp32","esp8266","led-controlling","led-matrix","led-strips","platformio"],"created_at":"2024-10-27T21:09:13.937Z","updated_at":"2025-03-20T02:30:54.473Z","avatar_url":"https://github.com/IoTPanic.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PIXELS - A super simple LED application layer\n\n**Don't use right now, this is unfinished and a much better version will be released soon**\n\nThis protocols goal is to allow for sending pixel data (color values) to rgb and rgbw stripes in a performant way. This is especially useful for sending data in \"realtime\" to led stripes connected to an ESP32 via WIFI/UDP.\n\nThis protocol was written originally for [udpx](https://github.com/martinberlin/udpx).\n\n## Installation\n\n### PlatformIO\n\nPlatformIO should automatically install this package if `https://github.com/IoTPanic/pixels.git` is added to the `lib_deps` section of `platformio.ini`. We plan on adding this library to PlatformIO library manager soon. If the current method is used, the library will be git cloned into `.pio/libdeps/` so if you need to switch to a development branch you can, remember to hit the trash can icon and clean the cache before building agian.\n\n### Arduino\n\nComing Soon, Just need to make a _library.properties_ but will be installable like any library.\n\n## Usage \n\n1. Install with the instructions provided in the installation section.\n2. If using RGBW LEDs, set the `RGBW` constant in `pixels.h` to `1`.\n3. If using LEDs that communicate in the GRB order, set the `GRB` constant in `pixels.h` to `1`.\n4. Set the `DRIVERMETHOD` in `pixels.h` to inform the neopixel library how to implement itself if your platform is not an ESP32 or ESP8266. Remember to remove the #error line to allow the library to compile if true.\n5. Import the `PIXELS` constructor into your application.\n6. In the setup code, use `bool addChannel(int pin, unsigned LED_count, uint8_t channel_number)` to connect one or many LED strips.\n7. Call `bool PIXELS::receive(uint8_t *pyld, unsigned length)` when ever pixels data is received with pyld being a uint8_t array and length being the array length. You may use any transport method you want, but check out [s - Little Stream - Embedded streaming layer for UDPX](https://github.com/IoTPanic/s).\n\n## Message Structure\n\nA message consists of a **header**, a **payload** and a **crc-check**:\n\n| Header (5Bytes) | Payload (x Bytes) | CRC-Check (1 Byte) |\n|:----------------|:------------------|:-------------------|\n\n\n### Header\n\n| Byte Number: | 1                     | 2         | 3              | 4-5                                                                                      |\n|:-------------|:----------------------|:----------|:---------------|:-----------------------------------------------------------------------------------------|\n|              | Message Type          | Sync Word | Channel Number | Length of payload                                                                        |\n| Data Type    | Uint8                 | Uint8     | Uint8          | 16 bit [LSB](https://developer.mozilla.org/de/docs/Glossary/Endianness) unsigned integer |\n| Example      | HEX: 0x50 / ASCII: 80 |           | 1              | 144                                                                                      |\n\n#### Message Type\n\nThe starting byte must be `0x50` which is ascii uppercase **'P'**. (This\nstands for 'pixels'). This is to verify that the message is in fact\npixel data.\n\nThere could be other protocols that always start with 0x50, but chances\nare good that you'll not face that kind of problem.\n\n#### Sync Word\n\nThis is to verify the right client is connected and the right mode is\non.\n\n#### Channel Number\n\nWhich channel of the controller should consume the payload to be sent?\n\n#### Length of payload\n\nHow many pixels will be in the payload?\n\n### Payload\n\n| Byte Number: | 1     | 2     | 3     | 4     | ... |\n|:-------------|:------|:------|:------|:------|:----|\n|              | R     | G     | B     | (W)   | ... |\n| Data Type    | Uint8 | Uint8 | Uint8 | Uint8 | ... |\n| Example      | 16    | 155   | 43    | 0     | ... |\n\nThe payload consists of RGB or RGBW values, depending on which mode is\nused. **The number of values sent in the payload must match \"Length of\npayload\" setting in the message header.** An RGB Value consists of 3\nUint8 values representing the brightness for the colors Red, Green and\nBlue.\n\nExample: this is 'red' (#ff0000)\n\n| 255 | 0 | 0 |\n|:----|:--|:--|\n\nAn RGBW Value consists of 4 Uint8 values representing the brightness for\nthe colors Red, Green and Blue and White. Example: this is 'pure white'\nusing the white led of an rgbw strip.\n\n| 0 | 0 | 0 | 255 |\n|:--|:--|:--|:----|\n\n### CRC Check\n\n| Byte Number: | 1     |\n|:-------------|:------|\n|              | CRC   |\n| Data Type    | Uint8 |\n| Example      | 34    |\n\n#### example implementation:\n\n```c++\nuint8_t crc = 0x0;\nfor(uint i = 0; i\u003csize;i++){\n   crc = crc ^ payload[i];\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiotpanic%2Fpixels","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiotpanic%2Fpixels","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiotpanic%2Fpixels/lists"}