For Thermal Flashlights, if your LED is not turning on, you may have the inverse type, where the shared longer pin actually needs to be connected to negative, not positive (or vice versa).
For LEDs that are common cathode instead of common anode, you have to connect the common (longer) lead to the ground (GND) instead of to 3v, and you have to change the following lines in the code on 138-141:
//set each component to a integer value between 0 and 255
int red=constrain(255-(int)255*r,0,255);
int green=constrain(255-(int)255*g,0,255);
int blue=constrain(255-(int)255*b,0,255);
Basically, I made it scale from 255-0 instead of 0-255; formerly, these lines were:
//set each component to a integer value between 0 and 255
int red=constrain((int)255*r,0,255);
int green=constrain((int)255*g,0,255);
int blue=constrain((int)255*b,0,255);
A complete alternate version is here:
0 Comments
Login to comment.