{"id":46767458,"url":"https://github.com/kylaro/firefly-led-framework","last_synced_at":"2026-03-09T22:39:26.397Z","repository":{"id":40695044,"uuid":"489778557","full_name":"kylaro/firefly-led-framework","owner":"kylaro","description":"Simple+powerful object-oriented LED control framework for WS2812B individually addressable LEDs.","archived":false,"fork":false,"pushed_at":"2024-12-30T11:16:27.000Z","size":23109,"stargazers_count":7,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-12-30T12:22:19.671Z","etag":null,"topics":["framework","led","led-controller","leds","raspberry-pi-pico","ws2812b","ws2812b-led"],"latest_commit_sha":null,"homepage":"","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/kylaro.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":"2022-05-07T20:47:37.000Z","updated_at":"2024-10-02T08:22:19.000Z","dependencies_parsed_at":"2024-08-11T02:44:32.292Z","dependency_job_id":"c2cec54f-61df-45ef-8c85-d7b026872831","html_url":"https://github.com/kylaro/firefly-led-framework","commit_stats":null,"previous_names":["kylaro/firefly-led-framework"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kylaro/firefly-led-framework","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylaro%2Ffirefly-led-framework","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylaro%2Ffirefly-led-framework/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylaro%2Ffirefly-led-framework/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylaro%2Ffirefly-led-framework/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kylaro","download_url":"https://codeload.github.com/kylaro/firefly-led-framework/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylaro%2Ffirefly-led-framework/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30314780,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-09T20:05:46.299Z","status":"ssl_error","status_checked_at":"2026-03-09T19:57:04.425Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["framework","led","led-controller","leds","raspberry-pi-pico","ws2812b","ws2812b-led"],"created_at":"2026-03-09T22:39:24.925Z","updated_at":"2026-03-09T22:39:26.081Z","avatar_url":"https://github.com/kylaro.png","language":"C","readme":"# kylarLEDs\n\n## Welcome to the FireFlies LED Framework by kylarLEDs!\n\n    The project uses a Raspberry Pi Pico on the kylarLEDs FireFly board!\n    Eventually the project will be hardware agnostic, so it should work for anything!\n\n    The sensors on the board are:\n        1. Microphone -\u003e for sound reactive LEDs\n        2. Potentiometer -\u003e for brightness control\n        3. Rotary encoder -\u003e for color/hue control\n        4. Rotary encoder button -\u003e for changing patterns\n\n    The outputs from the board are:\n        1. 2 x WS2812B LED output pins\n            a. Each pin has 2 output pads, one on front and one on back\n            b. Each pin has a 0.1 inch header port\n        2. 2 x USBC 5V power up to 3A\n\n    The input to the boards are:\n        1. Pico programming micro usb port (not meant for power)\n        2. 1 x USBC 5V power up to 3A\n\n## Quick start\n### You don't want the source, you just want to put it on your Pico\n    1. Go to the build folder and get the \"firefly.uf2\" file.\n    2. Follow instructions for \"Upload to Pico\"\n\n\n## Components\n    1. Pico\n        a. https://vilros.com/products/raspberry-pi-pico\n    2. Potentiometer\n        a. https://www.mouser.com/ProductDetail/652-PTV09A-4020FB104\n    3. Encoder\n        a. https://www.mouser.com/ProductDetail/652-PEC12R-4020F-S24\n    4. USBC\n        a. https://www.mouser.com/ProductDetail/GCT/USB4125-GF-A-0190\n    5. PDM Mic\n        a. https://www.mouser.com/ProductDetail/CUI-Devices/CMM-4737DT-26186-TR\n    6. Resistors - 0805 10K Ohm (for Encoder)\n        a. https://www.mouser.com/ProductDetail/Xicon/260-10K-RC\n    7. Capacitors - 0805 0.10 uF (for Encoder)\n        a. https://www.mouser.com/ProductDetail/KEMET/C0805C104M5RAC\n\n\n## Windows:\n    Getting started:\n    https://www.electronicshub.org/programming-raspberry-pi-pico-in-windows/\n\n    Getting started TLDR:\n        Download ARM Compiler: https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/downloads\n        Download CMake: https://cmake.org/download/\n        Download VS Build tools: https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2019\n\t\t- 2022 also works!\n        Download Pico SDK: https://github.com/raspberrypi/pico-sdk\n        Set Pico SDK Path: setx PICO_SDK_PATH \"..\\..\\pico-sdk\" \n\t\t- \"..\\..\\\" is just wherever you installed it, mine is \"C:\\pico\\pico-sdk\"\n\n    Building Cmake projects for Pico:\n        1. Clone the whole git repo\n        2. Open a \"Developer command prompt for VS 2019\"\n        3. Navigate to the cloned repo\n        4. cd build\n        5. cmake -G \"NMake Makefiles\" .. \n        6. nmake\n\n    Upload to Pico:\n        1. Hold \"boot select\" button on Pico\n        2. Plug into Computer (while button is held)\n        3. The pico should show up the same way a USB drive does\n        4. Drag \"firefly.uf2\" into the Pico filesystem\n        5. The pico will restart and begin running your code\n\n\n## Pico Documentation:\n    SDK: https://raspberrypi.github.io/pico-sdk-doxygen/index.html\n    C: https://datasheets.raspberrypi.com/pico/getting-started-with-pico.pdf\n    RP2040: https://datasheets.raspberrypi.com/rp2040/rp2040-datasheet.pdf\n\n\n## LED Library Architecture\n### You are encouraged to add to and edit:\n#### Patterns (user created)\n    • Pattern object is parent, user creates subclasses\n\t• Patterns have logic to decide which Effects to start\n        • Ex. using microphone data to spawn an effect\n    • Patterns manage their effects and add them to the EffectEngine\n    • Patterns do not directly write LEDs\n\n#### Effects (user created)\n\t• Effect object is parent, user creates subclasses\n\t• Have LED write control\n    • Use generators, LEDOutput\n\n#### source/main.cpp (carefully)\n    • You will need to add your patterns here for them to become selectable\n    • You should only need to change 1 line per pattern\n    • Just add a line under \"ADD YOUR PATTERNS HERE!\"\n\n### You do not need to worry about:\n#### LED Interface (library)\n\t• HW independent\n\t• Manages LEDs, count, current values, conversions\n    • Calls upon controller object to output\n    • Everything is normalized to 1.0 (this makes life easier)\n        • Fixed vs Floating performance is negligible from my quick test4\n\t• HSV/RGB support\n    • Adaptive framerate based on furthest LED index updated\n    • 1 interface per strip output\n\n#### Effect Engine (library)\n\t• Manage all effects\n\t• Combine every loop\n\t• Output using LED output\n\n#### Controller functionality (library)\n\t• Hue, brightness, pattern change\n\t• Contains the way that LED output is handled on the lowest level\n    • Also allows Sensors to connect somehow\n\n#### Sensors library (library)\n\t• Microphone\n        • This requires a lot of processing power for FFT/PDM\n    • Potentiometer\n    • Encoder\n    • Encoder Button\n    • Future Sensor ideas:\n        • Accel/Gyro\n        • Temp/Humidity\n        • Magnetic Sensor\n\n\n#### Generators (library)\n\t• Time dependent sin/triangle waves\n    • Noise functions (perlin )\n\n\n\n## KylarLEDs idea pad:\n### I want to benchmark different ways of doing the LEDStrip\n    Is it better to have an static array, dynamically allocated array, or a vector for keeping track of LEDChange objects. Maybe a map?\n        - I'd be interested in timing the different implementations\n        - Maybe I should add some sort of timing interface to easily do this :)\n\n    For the LEDChange objects, how should the combining be done? Simple average, or should there be a more complex way of combining overlapping colors?\n\n### Introduce LED objects, and a linked list of LED objects\n    It would be nice to be able to order LED is certain ways, kind of like a \"virtual strip.\" Having a linkedlist is just the first step, but like the Dome this would expand to being able to make a graph of LEDs.\n\n\n### Noise/color functions in the generator\n    Everyone seems to like perlin noise for cool color maps on grids/strips of LEDs\n    Imagine the generator can also support more color gradients that can be linearly scrolled through.\n    Is the generator class going to exist on its own, or will it have children? In that case, do the children have access to the static member \"controller\"?\n\n### List of things still need to add:\n    (Done) Support for multiple strips / multiple LED interfaces\n    FireFlys example pattern\n    Make a CMakeFile for the targeted controller to keep CMake hw agnostic\n    (Done) Add execution timing utility\n    Make the Controller have a static variable for the current controller in use / singleton pattern\n    Rename \"Examples\" for effects to \"Basic\" and have like single led fades and use them for fireflys\n    Have Basics be various Single LED stuff, and also various \"streamers\"\n    (Done) Make sure memory is being removed when doing done=1\n    (Done) Check EffectEngine clear() / rework what release() does\n    Add simple way to do gradients / time based HSV\n    Also a time based brightness to replace doing it manually in SingleTime.cpp\n    Make Encoder class not static - need to do the interrupts TODO\n    Make Encoder counts scale based on how fast it is turning\n    Fix interrupts - note \"GPIO parameter is ignored, callback will be called for any enabled GPIO IRQ pin\"\n        - see \"Button.cpp\" initialization for more detail\n    Detect high frequency output so that light doesn't flicker between brightness levels\n    Make sensor classes Static?\n    LEDStrip rework:\n        -remove led interface from main, have it be created by patterns\n        -instead of calling the leds apply and output from main, can be done in engine\n        -patterns would make their own led interface object with specified # leds\n        -controller need a way to change # leds, and save between power cycles\n    Take out the \"Single Time\"'s timing profile and put it in the Timer utility\n        -\u003e This is so it can be used for both brightness and saturation\n        -\u003e Maybe also add a way to do color by time :) \n            -\u003e Something like +0.001 / loop -\u003e 0.0x / ms\n            -\u003e I guess this can already be done with the timer-\u003eeveryMs(1) { hue+=0.01 } - but this could still be missed...\n            -\u003e need something that is like hue = timer-\u003etime()*0.01; // where Time() returns time in ms (double)\n    Make scaling for color change knob. Turning faster changes hue more, turning slow changes hue less\n        -\u003e use this algo in the next note for strip lengths..\n    Make ability to change strip lengths via encoder (hold down button for 3 seconds, then turn knob)\n        -\u003e note the note before this one, knob turn speed should make strip length adjust better\n        -\u003e the pico can detect \"level_low\" for detecting button held down.\n        -\u003e in level_low, set an interrupt for level_high that resets the timer and removes itself\n    Make sleep mode when potentiometer is turned down below \u003c0.02, see if pico has a wake up interrupt for this\n    Make a way for LEDStrip to accept saturation changes?\n        -\u003e So if I want to only change the saturation of a pixel, regardless of what is there\n        -\u003e Hard part is that LEDChanges store RGB, because it is easier to combine\n        -\u003e But HSV is only way to mix Saturation. Maybe there is a native HSV mix function, and we convert to RGB only for output\n    (Done) Make brightness change smooth.\n    Detect brightness flickering (especially for low brightness when pot rests between two levels and the noise changes the level)\n    Timer Utils like Triangle, Sin, Exp, square, to make easy waveforms\n    Make sound reactivity for highs\n    Make some form of persistence, and can use for saving color/current pattern\n    (Done) Try to improve the speed of the PIO LED output using DMA\n    Should we really clear the led rgb every time? or leave it up to the pattern programmer to manage when things should be off\n    Make memory allocation dynamic for LED outputs, instead of doing all 4 / or otherwise make memory usage less in LEDStrip\n    Make memory better, by having LEDChanges outsource their memory references?\n        - problem is that the brightness calculation is done at the end. so would need to move brightness calc to within ledchange\n        - but if calc is done in ledchange, then it would need to be done multiple times. It is fast though... I gotta check apply times...\n    Get rid of \"release()\" and just make everyone have a ~Destructor() which frees stuff instead, remove release support from engine\n    Make option to boot up in memory or speed centric, make 2 different LEDChange classes? One for mem, one for speed\n    Investigate difference of precision for float vs double\n    Expand capabilities of the config.h file!\n\n    Done:\n        Have ADC sample for pots be time/interrupt based (60hz or something)\n            Or have a poll time, so when it is moving it is more polled more\n         Controller Brightness control\n         Dynamic strip lengths - no predefined length\n        Controller Hue control\n        Controller Pattern button\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkylaro%2Ffirefly-led-framework","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkylaro%2Ffirefly-led-framework","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkylaro%2Ffirefly-led-framework/lists"}