{"id":19168447,"url":"https://github.com/srwi/fastledhub","last_synced_at":"2025-09-15T12:10:09.349Z","repository":{"id":40380961,"uuid":"75664686","full_name":"srwi/FastLEDHub","owner":"srwi","description":"Control multiple FastLED lightstrip animations on the ESP8266 and ESP32 without reuploading.","archived":false,"fork":false,"pushed_at":"2024-08-04T16:58:09.000Z","size":578,"stargazers_count":63,"open_issues_count":8,"forks_count":4,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-09-07T19:58:33.512Z","etag":null,"topics":["arduino","esp32","esp32-arduino","esp32-library","esp8266","esp8266-arduino","esp8266-library","fastled","hacktoberfest","leds","ws2812b"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/srwi.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":"2016-12-05T20:45:43.000Z","updated_at":"2025-08-04T14:26:24.000Z","dependencies_parsed_at":"2024-04-19T19:28:01.488Z","dependency_job_id":"afbef951-683f-4381-873e-974ef92c8d7f","html_url":"https://github.com/srwi/FastLEDHub","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/srwi/FastLEDHub","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srwi%2FFastLEDHub","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srwi%2FFastLEDHub/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srwi%2FFastLEDHub/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srwi%2FFastLEDHub/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/srwi","download_url":"https://codeload.github.com/srwi/FastLEDHub/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srwi%2FFastLEDHub/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275253896,"owners_count":25432177,"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","status":"online","status_checked_at":"2025-09-15T02:00:09.272Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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","esp32","esp32-arduino","esp32-library","esp8266","esp8266-arduino","esp8266-library","fastled","hacktoberfest","leds","ws2812b"],"created_at":"2024-11-09T09:42:40.989Z","updated_at":"2025-09-15T12:10:09.294Z","avatar_url":"https://github.com/srwi.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FastLEDHub\n\n![ESP8266](https://img.shields.io/badge/ESP-8266-000000.svg?colorB=blue)\n![ESP32](https://img.shields.io/badge/ESP-32-000000.svg?colorB=blue)\n[![LGPL-2.1 license](https://img.shields.io/github/license/srwi/FastLEDHub)](https://github.com/srwi/FastLEDHub/blob/master/LICENSE)\n\nFastLEDHub allows you to manage all of your [FastLED]([FastLED](https://github.com/FastLED/FastLED)) sketches on the ESP8266 and ESP32 with minimal changes to your existing code. It requires little knowledge about the ESP8266/ESP32 platform making it an ideal playground for beginners getting started with FastLED animations.\n\n## Features\n\n- Control multiple animations via an intuitive web interface\n- Adjust brightness and animation speed globally\n- Add widgets like color pickers or sliders to control complex animations\n- Alarm: Be woken up to an animation slowly fading in\n- Sunset: Automatically fade in an animation when the sun sets at your location\n- Control animations and brightness using hardware inputs\n- Incorporate audio spectrum data into your animations\n- Control animations using HTTP requests for easy automation\n\n## Demo\n\n![FastLEDHub web app screenshot](https://user-images.githubusercontent.com/17520641/163568239-527e2239-536c-4324-8e0f-5c712b3d4635.gif)\n\n\n## Installation\n\n### Library dependencies\n\n- ArduinoJson ≥ 7.0\n- ESPEssentials ≥ 2.1\n- FastLED\n- LinkedList\n- WebSockets\n- WiFiManager ≥ 2.0\n\n### Official releases via the Arduino IDE v1.8+\n1. Open the Arduino IDE\n2. Navigate to _\"Sketch\"_ \u0026#8594; _\"Include Library\"_ \u0026#8594; _\"Manage Libraries...\"_\n3. Search for `FastLEDHub` and install the desired version\n\n### Manual Installation\n\n1. Make sure you have installed the dependencies above\n2. Download the desired version from the [releases](https://github.com/srwi/FastLEDHub/releases) page\n3. Extract the contents of the downloaded zip file\n4. Rename the extracted folder to `FastLEDHub`\n5. Move this folder to your libraries directory `~/Arduino/libraries`)\n6. Restart your Arduino IDE\n\n### Using Git\n\n```bash\ncd ~/Arduino/libraries\ngit clone https://github.com/srwi/FastLEDHub.git\n```\n\nTo update to the latest version of the library\n\n```bash\ncd ~/Arduino/libraries/FastLEDHub \u0026\u0026 git pull\n```\n\n## Usage\n\nUsing FastLEDHub to manage your FastLED animations requires mainly four steps:\n\n- Creating the main sketch to initialize your lightstrip with FastLEDHub\n- Creating an animation or modifying an existing sketch to be compatible with FastLEDHub\n- Registering your animations in the main sketch\n- Uploading the web interface files to the flash storage\n\n### Creating the main sketch\n\n```cpp\n#include \u003cFastLEDHub.h\u003e\n\n#define NUM_LEDS 100\n#define LED_TYPE WS2812B\n#define LIGHTSTRIP_PIN 5\n\nCRGB leds[NUM_LEDS];\n\nvoid setup()\n{\n  FastLEDHub.initialize(\"Project Name\");\n  FastLEDHub.addLeds\u003cLED_TYPE, LIGHTSTRIP_PIN, GRB\u003e(leds, NUM_LEDS);\n}\n\nvoid loop()\n{\n  FastLEDHub.handle();\n}\n```\n\nChange `NUM_LEDS`, `LED_TYPE` and `LIGHTSTRIP_PIN` according to your hardware configuration. You may notice that this is not different than setting up a regular FastLED sketch apart from using `FastLEDHub` instead of `FastLED`.\n\n*Note:* By default FastLEDHub will apply gamma correction to the brightness value. To disable this behavior call `FastLEDHub.initialize(\"Project Name\", false)` instead.\n\n### Adding a new animation\n\nCreate a new animation file `Animations/ExampleAnimation.h`:\n\n```cpp\n#pragma once\n\n#include \u003cFastLEDHub.h\u003e\n\nextern CRGB leds[];\n\nclass ExampleAnimation : public Animation\n{\npublic:\n    using Animation::Animation;\n\n    // add variables and other functions if needed\n\n    void reset()\n    {\n      // set initial state variables\n    }\n\n    void loop()\n    {\n      // animate leds\n    }\n};\n```\n\nWhile creating your animation proceed as you usually would with FastLED by defining the `reset` and `loop` functions. `reset` will be called each time an animation gets started. Use this function to reset the state variables of your animation to its starting values. It will not be called when resuming the animation from the paused status. `loop` will be called repeatedly as long as the animation is running.\n\nKeep in mind the following important differences to just using FastLED:\n- The regular `setup` function is called `reset` to emphasize its purpose.\n- Since `leds` has already been defined in the main sketch, simply indicate its existence with `extern CRGB leds[]`.\n- Within your animation use `FastLEDHub[0].size()` instead of `NUM_LEDS` to get the number of leds. If you are using multiple lightstrips change the index accordingly.\n- Every time you may want to use `FastLED` use `FastLEDHub` instead. Since `FastLEDHub` inherits from `FastLED` all member functions will be available just like before. FastLEDHub just adds some stuff on top of that.\n\nIf you want to convert an existing FastLED sketch (e.g. from [atuline/FastLED-Demos](https://github.com/atuline/FastLED-Demos)), so it can be handled by FastLEDHub, generally those are the necessary changes you have to perform. Have a look at the examples for further insights.\n\n### Registering animations\n\nIn your main sketch include your animations and register them at the end of the `setup` function:\n\n```cpp\n#include \"Animations/ExampleAnimation.h\"\n\n...\n\nFastLEDHub.registerAnimation(new ExampleAnimation(\"Example animation name\"));\n```\n\nThe animation name can be any unique string and will be used to identify animations in the web interface.\n\n### Uploading web interface files\n\nTo be able to access the web interface, several files have to be uploaded to the flash storage. They are located within the `data` folder inside FastLEDHub's library folder. To upload those files there are two easy options:\n\n- Copy the whole `data` folder into your sketch directory and upload the files using the Arduino filesystem uploader ([ESP8266](https://github.com/esp8266/arduino-esp8266fs-plugin), [ESP32](https://github.com/me-no-dev/arduino-esp32fs-plugin)).\n- After the sketch has been flashed to the device upload each file within the `data` folder individually by accessing `http://\u003cdevice-ip\u003e/edit`.\n\n## Additional features\n\n### Custom color pickers\n\nFastLEDHub allows you to register multiple color pickers to use as parameters for your animations. This allows you to integrate custom colors, gradients and more.\n\nTo add a color picker use\n\n```cpp\nFastLEDHub.registerColorPicker(new ColorPicker(\"Primary Color\", CRGB(255, 0, 0)));\nFastLEDHub.registerColorPicker(new ColorPicker(\"Secondary Color\", CRGB(0, 255, 0), \"paint-bucket\"));\n```\n\nWithin the web interface FastLEDHub uses [Bootstrap icons](https://icons.getbootstrap.com/#icons) to allow you to further differentiate between color pickers. Here `paint-bucket` refers to the respective icon class.\n\nTo access those colors within your animation use\n\n```cpp\nCRGB primaryColor = FastLEDHub.getColorPicker(\"Primary Color\")-\u003evalue; // access by name\nCRGB secondaryColor = FastLEDHub.getColorPicker(1)-\u003evalue;             // access by index\n```\n\n### Pre-defined and custom sliders\n\nYou can add custom numeric sliders of type `int16_t` to adjust variables of animations dynamically. FastLEDHub automatically adds two sliders for brightness (0-255, default: 127) and animation speed (0-255, default: 127). Both of these fixed sliders have been integrated tightly into FastLEDHub and don't require any further attention. By default changing the brightness will apply gamma correction automatically. Adjusting the speed will affect the effective delay of `FastLEDHub.delay()` to speed up or slow down animations. To prevent this explicitly use `FastLED.delay()`.\n\nTo add more custom sliders simply register them in the main sketch via\n\n```cpp\nFastLEDHub.registerSlider(new Slider(\"Hue\", 0, 359, 180, 1));\nFastLEDHub.registerSlider(new Slider(\"Saturation\", 150, 255, 200, 1, \"palette\"));\n```\n\nAgain `\"palette\"` refers to an optional [Bootstrap icon](https://icons.getbootstrap.com/#icons) and the slider name can be any unique string identifying the slider in the web interface.\n\nTo access custom slider values inside of your animation use\n\n```cpp\nint16_t hue = FastLEDHub.getSlider(2)-\u003evalue;                   // access by index\nint16_t saturation = FastLEDHub.getSlider(\"Saturation\")-\u003evalue; // access by name\n```\n\n*Remember:* Since FastLEDHub comes with two pre-defined sliders `Brightness` and `Speed` the first custom slider will have index `2`.\n\n### Hardware inputs\n\nFastLEDHub supports a potentiometer for brightness adjustments and push buttons to play/pause and cycle through animations. They have to be specifically enabled with\n\n```cpp\nFastLEDHub.enablePotentiometer(potentiometerPin);\nFastLEDHub.enableToggleButton(togglePin);\nFastLEDHub.enableCycleButton(cyclePin);\n```\n\n### Alarm and sunset\n\nSetting up an alarm in the web interface will fade in a user defined animation over any period of time to wake you up in the morning. You can optionally set a different animation to be started after the fade in period has ended (i.e. full brightness has been reached).\n\nSimilarly the sunset feature will fade in an animation as soon as the sun sets at your location. Please configure latitude, longitude and time zone in the web interface beforehand.\n\n### Audio spectrum data\n\n[FastLEDHub-AudioViz](https://github.com/srwi/FastLEDHub_AudioViz) allows you to send audio spectrum data from a Windows audio device to your ESP32/ESP8266. The transmitted data consists of 16 bins corresponding to different frequency ranges in the audio spectrum. Data is transmitted via a websocket connection and can be used by accessing the `FastLEDHub.spectrumData` array from within your animation:\n\n```cpp\nuint8_t lowFrequencies = FastLEDHub.spectrumData[0];\nuint8_t highFrequencies = FastLEDHub.spectrumData[SPECTRUM_LENGTH - 1];\n```\n\n`SPECTRUM_LENGTH` defines the number of bins (16). The `Spectrogram` example shows one way to use the spectrum data in your animations.\n\n### Control via HTTP requests\n\nMost functions can be triggered via HTTP requests:\n\n- Begin animation by name: `http://\u003cdevice-ip\u003e/begin?animation=\u003canimation-name\u003e`\n- Begin animation by index: `http://\u003cdevice-ip\u003e/begin?index=\u003canimation-index\u003e`\n- Stop animation: `http://\u003cdevice-ip\u003e/stop`\n- Pause animation: `http://\u003cdevice-ip\u003e/pause`\n- Resume animation: `http://\u003cdevice-ip\u003e/resume`\n- Toggle animation: `http://\u003cdevice-ip\u003e/toggle`\n- Restart animation: `http://\u003cdevice-ip\u003e/restart`\n- Trigger sunset: `http://\u003cdevice-ip\u003e/sunset`\n- Trigger alarm: `http://\u003cdevice-ip\u003e/alarm`\n- Reset device: `http://\u003cdevice-ip\u003e/reboot`\n\n## License \u0026 Attribution\n\nFastLEDHub is licensed under LGPL-2.1 and uses the [sunrise-sunset.org](https://sunrise-sunset.org/api) api to retrieve sunset times.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsrwi%2Ffastledhub","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsrwi%2Ffastledhub","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsrwi%2Ffastledhub/lists"}