Building Class Librarys

Thank you very much for your fast reply PaulS! :slight_smile:

I think I understod your advice regarding the begin() and init of hardware in a library.
I fill only the variables inside the constructor and afterwards I call the begin() function in the
setup-function to init the hardware:

CPP:

FadeLED::begin()
{
     pinMode(_pin, OUTPUT);
}

Sketch:

#include <FadeLED.h>

FadeLED myLed(10,50);

void setup()
{
    myLed.begin();
}

void loop()
{
    myLed.fade();
}

Is this correct?

Unfortunately I dont really understand what you mean reagrding the array declaration especially
your statement:

You need to have 64 lines to initialize each element.

Could you post an example how to declare an array inside a library?
Is the array declaration the main problem of my compiler error?

Thank you! :slight_smile: