(2024-03 .. 2024-05)
Arduino library to control LED stripe.
My journey to the land of AVR assembly programming and back. There are some dragons.
Arduino. AVR. ATmega328/P. 16 MHz. RGB LED stripe. WS2812B. Function. C. Assembler. GPL3.
- arduino-cli
- bash
Run Install.sh.
Run Remove.sh.
#include <me_Ws2812b.h>
...
using namespace me_Ws2812b;
TPixel Pixels[] =
{
{ .Green = 0xFF, .Red = 0, .Blue = 0 },
{ .Green = 0, .Red = 0xFF, .Blue = 0 },
{ .Green = 0, .Red = 0, .Blue = 0xFF },
};
TLedStripeState State;
State.Pixels = Pixels;
State.Length = sizeof(Pixels) / sizeof(TPixel);
State.Pin = A0;
SetLedStripeState(State);
See examples for real code.
Code is readable.
I'm aware of them and intentionally decided to write my own.
Main issue there is bad design. It's unlimited. They are trying to write multi-platform code in C lol. And they are putting all the fancy color manipulation routines in their libraries. Neverending projects.
More important, you can't change LED output pin at runtime there.
- My development rantings
- Additional documentation (Datasheet, oscilloscope timings, sticky pins weirdness.)
- My other repositories