Writing Arduino Library - Understanding class constructors

Good evening,

I'm working on a new project and have decided to tidy up my code this time around by writing a couple of libraries. I'm starting small with a library that will blink/pulse an LED and I'm working my way through the Arduino library tutorial (http://arduino.cc/en/Hacking/LibraryTutorial). I've started with my header and understand that the class defines my group of variables and functions to be defined and whatnot however I'm a little confused about the class constructor. Is this similar in function to say the serial.begin function? If so, how can I allow for several arguments? I want the library to allow for multiple LED's off the bat and I figure their pins should be collected in the constructor to initialize them. Header so far seen below.

 LED.h - LED library to flash/pulse individual LED's
#ifndef LED_h
#define LED_h

#include "Arduino.h"

class LED
    LED(int pin1, int pin2, int pin3...);
    void flash();
    void pulse();
    int _pin1;
    int _pin2;
    int _pin3;



You can have multiple constructors as long as their signatures are different. A nice short discussion can be found at:


You could have the constructor take two arguments - an array of pin numbers and the number of pin numbers.

Actually after mulling around for a while I realized that I could just create a new instance for each LED. Perhaps not as slick but it should work for now Thanks for all of the input though!