Skip to content

r41d/WS2801FX

 
 

Repository files navigation

WS2801FX library

WS2801FX - More Blinken for your LEDs!

This is a fork of WS2812FX, adapted to WS2801 using the Adafruit_WS2801 Library. This library features a variety of blinken effects for the WS2801 LEDs. It is meant to be a drop-in replacement for the Adafruit WS2801 Library with additional features.

WS2801FX specific notes

  • The clear method was manually implemented because it's not a part of Adafruits's WS2801 library.
  • Additionaly to RGB and GRB (which WS2801 lib can handle), a hack was put in place so this lib can also handle RBG strips (these do exist).
  • A setPixelColor wrapper method was implemented which takes care of setting pixels with the current brightess, the setPixelColor in WS2801 library doesn't account for that.
  • Contrary to the Adafruit NeoPixel library, the Adafruit WS2801 Library does not feature the setBrightness function, which is called in various places. WS2801FX contains an attempt to emulate this, but this is still buggy at the moment. Therefore modes Breath and Fade don't work.

Features

  • 47 different effects. And counting.
  • Free of any delay()
  • Tested on Arduino and ESP8266.
  • All effects with printable names - easy to use in user interfaces.
  • FX, speed and brightness controllable on the fly.
  • Ready for sound-to-light (see external trigger example)

Download, Install and Example

  • Install the famous Adafruit WS2801 Library
  • Download this repository.
  • Extract to your Arduino libraries directory.
  • Open Arduino IDE.
  • Now you can choose File > Examples > WS2801FX > ...

See examples for basic usage.

In it's most simple form, here's the code to get you started!

#include <WS2801FX.h>

#define LED_COUNT 60
#define LED_DATA_PIN 12
#define LED_CLOCK_PIN 14

WS2801FX ws2801fx = WS2801FX(LED_COUNT, LED_DATA_PIN, LED_CLOCK_PIN, WS2801_RGB);

void setup() {
  ws2801fx.init();
  ws2801fx.setBrightness(100);
  ws2801fx.setSpeed(200);
  ws2801fx.setMode(FX_MODE_RAINBOW_CYCLE);
  ws2801fx.start();
}

void loop() {
  ws2801fx.service();
}

Effects

  • Static - No blinking. Just plain old static light.
  • Blink - Normal blinking. 50% on/off time.
  • Breath - Does the "standby-breathing" of well known i-Devices. Fixed Speed.
  • Color Wipe - Lights all LEDs after each other up. Then turns them in that order off. Repeat.
  • Color Wipe Random - Turns all LEDs after each other to a random color. Then starts over with another color.
  • Random Color - Lights all LEDs in one random color up. Then switches them to the next random color.
  • Single Dynamic - Lights every LED in a random color. Changes one random LED after the other to another random color.
  • Multi Dynamic - Lights every LED in a random color. Changes all LED at the same time to new random colors.
  • Rainbow - Cycles all LEDs at once through a rainbow.
  • Rainbow Cycle - Cycles a rainbow over the entire string of LEDs.
  • Scan - Runs a single pixel back and forth.
  • Dual Scan - Runs two pixel back and forth in opposite directions.
  • Fade - Fades the LEDs on and (almost) off again.
  • Theater Chase - Theatre-style crawling lights. Inspired by the Adafruit examples.
  • Theater Chase Rainbow - Theatre-style crawling lights with rainbow effect. Inspired by the Adafruit examples.
  • Running Lights - Running lights effect with smooth sine transition.
  • Twinkle - Blink several LEDs on, reset, repeat.
  • Twinkle Random - Blink several LEDs in random colors on, reset, repeat.
  • Twinkle Fade - Blink several LEDs on, fading out.
  • Twinkle Fade Random - Blink several LEDs in random colors on, fading out.
  • Sparkle - Blinks one LED at a time.
  • Flash Sparkle - Lights all LEDs in the selected color. Flashes single white pixels randomly.
  • Hyper Sparkle - Like flash sparkle. With more flash.
  • Strobe - Classic Strobe effect.
  • Strobe Rainbow - Classic Strobe effect. Cycling through the rainbow.
  • Multi Strobe - Strobe effect with different strobe count and pause, controled by speed setting.
  • Blink Rainbow - Classic Blink effect. Cycling through the rainbow.
  • Chase White - Color running on white.
  • Chase Color - White running on color.
  • Chase Random - White running followed by random color.
  • Chase Rainbow - White running on rainbow.
  • Chase Flash - White flashes running on color.
  • Chase Flash Random - White flashes running, followed by random color.
  • Chase Rainbow White - Rainbow running on white.
  • Chase Blackout - Black running on color.
  • Chase Blackout Rainbow - Black running on rainbow.
  • Color Sweep Random - Random color intruduced alternating from start and end of strip.
  • Running Color - Alternating color/white pixels running.
  • Running Red Blue - Alternating red/blue pixels running.
  • Running Random - Random colored pixels running.
  • Larson Scanner - K.I.T.T.
  • Comet - Fireing comets from one end.
  • Fireworks - Firework sparks.
  • Fireworks Random - Random colored firework sparks.
  • Merry Christmas - Alternating green/red pixels running.
  • Fire Flicker - Fire flickering effect. Like in harsh wind.
  • Fire Flicker (soft) - Fire flickering effect. Runs slower/softer.

Projects using WS2801FX

  • none yet

Projects using the original WS2812FX

About

WS2801FX Library for Arduino and ESP8266 (fork of WS2812FX)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 100.0%