Arduino library to perform synchronous blinking operations with LEDs and NeoPixels.
This library allows you to blink as many LEDs and NeoPixels as you want synchronously without interfering each other progress.
This library has two dependencies:
You must have them installed in your environment in order for it to compile.
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);
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;
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);
}
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();
}
You are now ready to start calling the methods of your LEDs and NeoPixels.