Hi,
I am having some trouble when trying to return an integer array from a function. I believe the problem is that I am mixing up pointers with their values but I cannot find the cause of the issue.
This program is for an LED clock and I have posted the code causing the issue below. You can see the full code here: https://hastebin.com/xebigoquxa.cpp
int getRGB(String req) {
static int colors[3];
int startPoint = req.indexOf("/setcolor/");
Serial.println(req);
String colorRGB = getStringPartByNr(req, '/', 2);
colors[0] = getStringPartByNr(colorRGB, '-', 0).toInt();
colors[1] = getStringPartByNr(colorRGB, '-', 1).toInt();
colors[2] = getStringPartByNr(colorRGB, '-', 2).toInt();
return(colors);
}
The function is called with 'primarynightmodecolor = getRGB(req);' where primarynightmodecolor is an array of three integers. When compiling I get the error: invalid conversion from 'int*' to 'int' [-fpermissive]
Here is the full error log: https://hastebin.com/iqenonejeh.http
I made a few changes between this and the last revision so there may be other bugs, but this is the one that I am unable to fix.
Hope someone can help out,
Dom