oh, my bad! Thanks for the correction.
I still have trouble, but it is in the .cpp file now.
In class B constructor i'm trying to initialise the array of A objects without any luck.
LEDLamps.cpp: In constructor 'LEDLamps::LEDLamps(int8_t, int8_t, int8_t)':
LEDLamps.cpp:66: error: no matching function for call to 'Wave::Wave()'
LEDLamps.cpp:14: note: candidates are: Wave::Wave(int, int, int, int, int)
LEDLamps.h:23: note: Wave::Wave(const Wave&)
Here are some of my real code, might be easier to help then.
h file:
static const int numberOfWaves = 20;
// ------------------------------------------------------------------------------------------- //
class Wave
{
public:
Wave(int speed, int blockSize, int ledCount, int lightness,int startCount); // Constructor
private:
};
// ------------------------------------------------------------------------------------------- //
class LEDLamps
{
public:
LEDLamps(int8_t lampCount, int8_t dataPin, int8_t clockPin);
private:
Wave waveArray[numberOfWaves];
};
My .cpp code, in Class B (LEDLamps) constructor i'm trying to initialise Class A (Wave) object to the array.
Wave::Wave(int speed, int blockSize, int ledCount, int lightness, int startCount)
{
// Doing some stuff...
}
// ------------------------------------------------------------------------------------------- //
LEDLamps::LEDLamps(int8_t lampCount, int8_t dataPin, int8_t clockPin)
{
int i;
for (i = 0; i < numberOfWaves; i++) {
waveArray[i] = Wave(10,2,25,150,100);
}
}
What i understand from that error message the parameters are wrong but i'm sending 5 integer and constructor is defined to receive 5 integer? So i must be doing something else wrong...