LedSync

Arduino library to perform synchronous blinking operations with LEDs and NeoPixels.

LedSync Arduino Library

License

Introduction

This library allows you to blink as many LEDs and NeoPixels as you want synchronously without interfering each other progress.

Dependencies

This library has two dependencies:

You must have them installed in your environment in order for it to compile.

Getting started

Creating a LED Object

LED Class

This object represents a LED with all its methods and properties. You must create one of this objects for each connected LED and pass the pin number where the LED is connected as an argument of the constructor method of the class.

Led myLed(pin, polarity);

Creating NeoPixel Object

NeoPixel Class

This object represents a NeoPixel with all its methods and properties. You must create one of this objects for each NeoPixel. The order in which these objects are created must match their position in the NeoPixelStrip.

NeoPixel myPixel;

Adding Objects to LedSync

LedSync is the core processor object, you must add to it, all instances of LEDs and NeoPixels. Don’t forget to pass them as reference, otherwise it won’t compile.

void setup(){
  // Add the LED Object
  LedSync.add(&myLed);
  // Add the NeoPixel Object
  LedSync.add(&myPixel);
}

Feed it

In order for LedSync to work, it must have a feeding from the program loop, so don’t forget to always call LedSync.update() in the loop.

void loop(){
  LedSync.update();
}

That’s it!

You are now ready to start calling the methods of your LEDs and NeoPixels.

LED Class

NeoPixel Class

Color Class

LedSync Class

MIT © Evert Arias