PaulStoffregen / OctoWS2811

Control thousands of WS2811/2812 LEDs at video refresh speeds
http://www.pjrc.com/teensy/td_libs_OctoWS2811.html
267 stars 118 forks source link

Adding empty constructor #26

Open Aranoh opened 6 years ago

Aranoh commented 6 years ago

Adding an empty constructor to be able to construct an empty version of OctoWS2811 to be filled later from another class.

example:

OctoWS2811 leds();
leds = OctoWS2811(LedsPerStrip, displayMemory, drawingMemory, config);
leds.begin();

note: not a native c++ programmer but i did not find any other way to make a construction like this unless i added this constructor myself. Would like to have it added to the library so we don't have to use our own version of OctoWS2811. Change did not seem to do any harm to the rest of the code.

Any comments/advice welcome.

PaulStoffregen commented 6 years ago

Why is this needed? I'm not going to merge this unless there is a compelling use case.

Maybe an example would help?

Aranoh commented 6 years ago

Hey PaulStoffregen, Thanks for the response.

I am writing a 'game engine' for LED screens, needing to write a wrapper library around the OctoWS2811 library to call/create functions like DrawCircle / DrawLine / ShowImage.

As i am not having every code in a single class (as the example shows on https://www.pjrc.com/teensy/td_libs_OctoWS2811.html), instead i need to initialize this 'leds' object in the wrapper class. Since i need the leds object to be available in the entire scope of the wrapper class i need some sort of empty object reference to OctoWS2811 at my class fields to be able to fill and use this later.