Hello, I am new to Arduino, I tested some basic examples and noticed on one of them what it looks to be an error.
the example is part of the commonication -> SerialCallResponseASCI
// if you're using a common-cathode LED, just use "constrain(color, 0, 255);"
red = 255 - constrain(red, 0, 255);
green = 255 - constrain(green, 0, 255);
blue = 255 - constrain(blue, 0, 255);
if this is common annode it should invert the signals, substracting from 255 is not the same as inverting.
I tried on the example sending different rgb colors and they are all wrong on my rgb led when mixing different values (between 1 and 254)
I changed this code for:
//red = 255 - constrain(red, 0, 255);
//green = 255 - constrain(green, 0, 255);
//blue = 255 - constrain(blue, 0, 255);
red = constrain(red, 0, 255) ^ B11111111;
green = constrain(green, 0, 255) ^ B11111111;
blue = constrain(blue, 0, 255) ^ B11111111;
this fixed the colors by inverting the bist, please let me know if I am wrong