SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By brianuno
#193288
I got the Tinker Kit multi-color RGB LED circuit to work. Before I take it apart, can anyone suggest which code elements can be changed for different color patterns? My understanding is that code can be changed in the IDE window and the new sketch saved as a separate file. A search of RGB LED resulted in over 900 results. If there was once a great thread on the subject please provide link.
User avatar
By darrellg
#193308
The comments in the code at https://learn.sparkfun.com/tutorials/ex ... an-rgb-led tell you which of the LED junctions is turning on in each section of the program. If you want something other that full red, green, blue, cyan, magenta, yellow, or white, you're going to have to use analogWrite instead of digitalWrite to vary the duty cycle of each junction.
By brianuno
#193315
That works. I swapped green "high" for red, and red "high" for green. Lucky for me I read about high and low somewhere else. Now, the initial blinking sequence is GRB, etc., instead of RGB. For the benefit of any other newbies struggling with this, a screen shot of my code changes in the IDE window is attached.
Thanks!
While I was waiting for advice, I tried changing the length of time the color stays lit. The original value is 100 milliseconds. I increased that value to what is shown in the pasted code. Will that work in theory? I don't trust my eyes.

// This variable controls how fast we loop through the colors.
// (Try changing this to make the fading faster or slower.)

int DISPLAY_TIME = 50000; // In milliseconds
You do not have the required permissions to view the files attached to this post.