morphogencc / ofxPixelPusher

A C++ library to control PixelPusher LED Controllers, designed with openFrameworks in mind.
MIT License
20 stars 7 forks source link

ofxPixelPusher

A C++ implementation of pixelpusher software.

Requirements

This add-on requires ofxAsio for networking. See the repository for how to setup ofxAsio.

This implementation of the pixelpusher protocol attempts to be as framework-agnostic as possible; thus, it tries to avoid using openFrameworks-specific classes such as ofLog and ofThread, instead using the c++ equivalents. ofxAsio follows a similar paradigm, so the entire project should be portable to any other C++ framework.

Usage

In your application, create a std::shared_ptr<DiscoveryService> instance using DiscoveryService::getInstance(). This creates a separate thread that looks for PixelPusher announcements, and registers the PixelPushers with the Service.

Once a PixelPusher is detected, you can grab one with any of the three following methods:

The first two methods return a vector of shared pointers (std::vector<shared_ptr<PixelPusher> >), while the last one returns either an empty pointer or a pointer to a PixelPusher.

Once a PixelPusher is selected, strips can be assigned values with

The first method sets all pixels in the strip stripNumber to the same color, while the latter method copies the vector of Pixel objects directly to the Strip objects. See the header file Strip.h for a more exhaustive listing of ways to set pixels.

Alternatively, you can call getStrips() on a PixelPusher object to get a deque of strips that you can iterate through, or getStrip(int stripNumber) to get a pointer to a particular strip. Once you have a pointer to a Strip, you can set the pixels with a variety of methods -- look at the header file to see a complete listing.

Each PixelPusher object automatically creates its own CardThread that manages sending data to the PixelPusher on its own thread. As long as you update the strips to reflect current data, everything else should run itself!

Options

There are a variety of options that can be used to adjust the LEDs. Currently implemented are:

Examples

Contributions

This project uses the Git Flow paradigm. Before contributing, please make your own feature branch with your changes.

This project was originally developed at Small Design Firm, before being open sourced on Github.

More Information / Credits

For more info about PixelPusher visit:

To purchase a PixelPusher (and BetterPixel products), go to:

Color Correction and Color Temperature presets were lifted straight from the FastLED library.