- Fri Apr 28, 2017 3:40 pm
#65371
J6r06n, you was perfectly right. The max brightness is indeed limited without your additional code. Thanks man, very nice find!
@Mike88: Just add the lines to the setHex() section like this:
Code: Select allvoid setHex() {
state = 1;
long number = (long) strtol( &hexString[0], NULL, 16);
r = number >> 16;
g = number >> 8 & 0xFF;
b = number & 0xFF;
r = map(r, 0, 255, 0, 1023);
g = map(g, 0, 255, 0, 1023);
b = map(b, 0, 255, 0, 1023);
analogWrite(redPin, (r));
analogWrite(grnPin, (g));
analogWrite(bluPin, (b));
}
By the way, I noticed an LM7805 gets quite warm while connected to the 12V source, no matter if the LED strip is switched on or off. Guess something around 45-50°C, this won't damage the regulator but nevertheless I added a small heatsink to it. If anyone has a better solution to bring the source down to about 5V/1A, please leave a comment.