I fixed it! You could never belive the mistake I made... That was my code (I won't post the whole one because it's not necessary):
#include <Led.h>
Led led[8]; // Object belonging to the Led class
void setup()
{
Serial.begin(115200); // Set the serial comunication speed
pinMode(SER, OUTPUT); // Set inputs/outputs
pinMode(SHCLK, OUTPUT);
pinMode(RCLK, OUTPUT);
}
void loop()
{
if (Serial.available() > 23)[u];[/u] // <-- the semicolon was the error!
{
// Reads the upcoming 24 bytes
for (int i = 0; i < 8; i++)
{
led[i].red = Serial.read() - '0';
led[i].green = Serial.read() - '0';
led[i].blue = Serial.read() - '0';
Serial.print("red["); Serial.print(i); Serial.print("] = ");
Serial.println(led[i].red);
Serial.print("green["); Serial.print(i); Serial.print("] = ");
Serial.println(led[i].green);
Serial.print("blue["); Serial.print(i); Serial.print("] = ");
Serial.println(led[i].blue);
}
}
....
}
In my 1st post the semicolon didn't appear because I didn't copy-paste the text interly (I wrote the first 2 lines manually) but the mistake - into the sketch - was there!
Thanks for your help anyway