Declaring class objects within a class

MattGr - the code in your attached files compiles just fine for me after the syntax of that constructor is fixed. Here's the fixed MGLED73.cpp

//7-segment 3-unit LED class

#include "Arduino.h"
#include "MGLED73.h"


MGLED73::MGLED73(int pin0, int pin1, int pin2, bool activeHigh)
: LED0(pin0,activeHigh,true), LED1(pin1,activeHigh,true), LED2(pin2,activeHigh,true) {
 //Original code
 //LED0 = new MGLED7(pin0,activeHigh,true);
 //LED1 = new MGLED7(pin1,activeHigh,true);
 //LED2 = new MGLED7(pin2,activeHigh,true);
}

void MGLED73::clear()
{
 LED0.clear();
 LED1.clear();
 LED2.clear();
}

void MGLED73::lightAll()
{
 LED0.lightAll();
 LED1.lightAll();
 LED2.lightAll();
}


void MGLED73::showNum(int value)
{
 //To code
}

topic_97968.zip (3.11 KB)