I've created 1 library with 2 classes. Class Wave and Class LEDLamps. In the second class constructor i'm trying to populate a array of first class objects without any luck.
Here are some parts of my real code. 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); //Constructor
private:
Wave waveArray[numberOfWaves];
};
.cpp file
Wave::Wave(int speed, int blockSize, int ledCount, int lightness, int startCount) //Constructor
{
// Doing some stuff...
}
// ------------------------------------------------------------------------------------------- //
LEDLamps::LEDLamps(int8_t lampCount, int8_t dataPin, int8_t clockPin) //Constructor
{
int i;
for (i = 0; i < numberOfWaves; i++) {
waveArray[i] = Wave(10,2,25,150,100);
}
}
Error messages:
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&)
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 something else i'm doing wrong...