Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding empty constructor #26

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

Aranoh
Copy link

@Aranoh Aranoh commented Jun 25, 2018

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
Copy link
Owner

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

Maybe an example would help?

@Aranoh
Copy link
Author

Aranoh commented Jun 26, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants