FI
fikrielektro21/WS2812B_ColorFX
Real-time RGB, HSV, and HSL color control for WS2812B on STM32 Blue Pill --[this is my first time trying to convert rgb led colors to hsl and hsv]
WS2812B Color Space Converter for STM32 Blue Pill
Real-time RGB, HSV, and HSL color control for WS2812B LED strips โ running natively on STM32F103C8T6 (Blue Pill) with zero external libraries and integer-only math.
Perfect for embedded projects where floating-point is unavailable or inefficient.
๐ก Why HSL? HSV gives vibrant colors, while HSL produces soft pastels โ ideal for ambient lighting, mood indicators, and artistic displays.
โจ Features
- โ
Full RGB โ HSV โ HSL conversion in pure C (no
floatormath.h) - โ Per-pixel or global color control in any color space
- โ Hardware-accelerated via PWM + DMA (non-blocking, timing-perfect)
- โ
Built-in animated effects:
- Rainbow (RGB/HSV/HSL)
- Smooth breathe
- Fire flicker
- Theater chase
- Pastel wave (HSL-only)
- โ No dependency on FastLED, Adafruit NeoPixel, or Arduino
- โ Ready for real-time applications (e.g., sensor-driven color feedback)
๐ ๏ธ Hardware Requirements
| Component | Notes |
|---|---|
| STM32 Blue Pill | STM32F103C8T6 (72 MHz Cortex-M3) |
| WS2812B LED Strip | Any length (tested with 8โ60 LEDs) |
| Level Shifter (Optional) | Recommended for >10 LEDs (3.3V โ 5V) |
| Power Supply | External 5V for LED strip (do not power from Blue Pill!) |
๐ Pinout:
- WS2812B DATA IN โ PA6 (TIM3_CH1)
- Shared GND between Blue Pill and LED strip
๐ป Software Requirements
- IDE: STM32CubeIDE (v1.15+)
- HAL: STM32CubeF1 (v1.8.6+)
- Clock: 72 MHz (HSE + PLL)
- Timer: TIM3 in PWM mode
- DMA: Channel for TIM3_CH1
๐ฆ No external libraries โ everything is self-contained!
๐ Project Structure
On this page
Languages
C89.3%Linker Script10.7%
Contributors
MIT License
Created November 30, 2025
Updated January 9, 2026