Skip to content

martin-eden/Embedded-me_Ws2812b

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What

(2024-03 .. 2024-05)

Arduino library to control LED stripe.

My journey to the land of microcontrollers programming and back. There are some dragons.

Buzzwords description

Arduino. AVR. ATmega328/P. 16 MHz. RGB LED stripe. WS2812B. Function. C. Assembler. Standalone implementation. GPL3.

Requirements

  • arduino-cli
  • bash

Install

Run Install.sh.

Remove

Run Remove.sh.

How

#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

Code is readable.

Other people implementations

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.

See also

Releases

No releases published

Packages

No packages published