<?xml version="1.0" encoding="UTF-8"?>        <rss version="2.0"
             xmlns:atom="http://www.w3.org/2005/Atom"
             xmlns:dc="http://purl.org/dc/elements/1.1/"
             xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
             xmlns:admin="http://webns.net/mvcb/"
             xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
             xmlns:content="http://purl.org/rss/1.0/modules/content/">
        <channel>
            <title>
									LED color vs. LED brightness? - Electronic Components &amp; Theory				            </title>
            <link>https://forum.dronebotworkshop.com/electronic-components/led-color-vs-led-brightness/</link>
            <description>Discussion board for Robotics, Arduino, Raspberry Pi and other DIY electronics and modules. Join us today!</description>
            <language>en-US</language>
            <lastBuildDate>Thu, 21 May 2026 14:42:30 +0000</lastBuildDate>
            <generator>wpForo</generator>
            <ttl>60</ttl>
							                    <item>
                        <title>RE: LED color vs. LED brightness?</title>
                        <link>https://forum.dronebotworkshop.com/electronic-components/led-color-vs-led-brightness/#post-12953</link>
                        <pubDate>Wed, 23 Sep 2020 22:55:08 +0000</pubDate>
                        <description><![CDATA[@zoolandermicro
Welcome aboard, zoolander!
Very COOL code!
Thank you very much!]]></description>
                        <content:encoded><![CDATA[<p>@zoolandermicro</p>
<p>Welcome aboard, zoolander!</p>
<p>Very COOL code!</p>
<p>Thank you very much!</p>
<p> </p>]]></content:encoded>
						                            <category domain="https://forum.dronebotworkshop.com/electronic-components/">Electronic Components &amp; Theory</category>                        <dc:creator>JoeLyddon</dc:creator>
                        <guid isPermaLink="true">https://forum.dronebotworkshop.com/electronic-components/led-color-vs-led-brightness/#post-12953</guid>
                    </item>
				                    <item>
                        <title>RE: LED color vs. LED brightness?</title>
                        <link>https://forum.dronebotworkshop.com/electronic-components/led-color-vs-led-brightness/#post-12943</link>
                        <pubDate>Wed, 23 Sep 2020 18:18:41 +0000</pubDate>
                        <description><![CDATA[#include 
#include 
/**
   Scetch ColorBlend_CommonCathode is a color fade/blend routine for a tri-color
   common cathode led connected to Arduino Uno digital pins 9, 10, and 11 as PWM...]]></description>
                        <content:encoded><![CDATA[<pre>#include 
#include 
/**
   Scetch ColorBlend_CommonCathode is a color fade/blend routine for a tri-color
   common cathode led connected to Arduino Uno digital pins 9, 10, and 11 as PWM
   outputs. Colors transition from blue through teal, green, yellow, orange, red,
   violet, purple, and back to blue. With common cathode tri-colored leds,
   analogWrite() value of 0 results in a full 'off' state, and analogWrite()   
   value of 255 results in a full 'on' state. This scetch works with common
   anode tri-colored leds, only the color blend runs in the opposite order.
   Written in Arduino C language.
   @author Mike Tonge
   @date 12/03/2019
*/
// Constants
const uint8_t DELAY_TIME = 100; // Delay time (miliseconds)
const uint8_t redLED = 9; // Red on digital pin 9
const uint8_t grnLED = 10; // Green on digital pin 10
const uint8_t bluLED = 11; // Blue on digital pin 11
const uint8_t OFF = 0; // Value used to turn led off
// Variables
uint8_t redVal = 0; // Red value
uint8_t grnVal = 0; // Green value
uint8_t bluVal = 0; // Blue value

void setup() {
  pinMode(redLED, OUTPUT); // Set pin 9 as output
  pinMode(grnLED, OUTPUT); // Set pin 10 as output
  pinMode(bluLED, OUTPUT); // Set pin 11 as output
}

void loop() {
  for (int count = 0; count &lt;= 765; count++) {
    switch (count) {
      // Red is off, Green gets brighter, Blue gets dimmer
      case 0 ... 255:
        redVal = OFF;
        grnVal = count;
        bluVal = 255 - count;
        break;
      // Red gets brighter, Green gets dimmer, Blue is off
      case 256 ... 510:
        redVal = count - 255;
        grnVal = 510 - count;
        bluVal = OFF;
        break;
      // Red gets dimmer, Green is off, Blue gets brighter
      case 511 ... 765:
        redVal = 765 - count;
        grnVal = OFF;
        bluVal = count - 510;
        break;
      default:
        break;
    } // End switch
    analogWrite(redLED, redVal);
    analogWrite(grnLED, grnVal);
    analogWrite(bluLED, bluVal);
    delay(DELAY_TIME);
  }
}
 </pre>]]></content:encoded>
						                            <category domain="https://forum.dronebotworkshop.com/electronic-components/">Electronic Components &amp; Theory</category>                        <dc:creator>ZoolanderMicro</dc:creator>
                        <guid isPermaLink="true">https://forum.dronebotworkshop.com/electronic-components/led-color-vs-led-brightness/#post-12943</guid>
                    </item>
				                    <item>
                        <title>RE: LED color vs. LED brightness?</title>
                        <link>https://forum.dronebotworkshop.com/electronic-components/led-color-vs-led-brightness/#post-12942</link>
                        <pubDate>Wed, 23 Sep 2020 18:04:22 +0000</pubDate>
                        <description><![CDATA[]]></description>
                        <content:encoded><![CDATA[<p>https://forum.dronebotworkshop.com/question-suggestion/sticky-post-for-editing/#post-4939</p>
<p> </p>]]></content:encoded>
						                            <category domain="https://forum.dronebotworkshop.com/electronic-components/">Electronic Components &amp; Theory</category>                        <dc:creator>robotBuilder</dc:creator>
                        <guid isPermaLink="true">https://forum.dronebotworkshop.com/electronic-components/led-color-vs-led-brightness/#post-12942</guid>
                    </item>
				                    <item>
                        <title>RE: LED color vs. LED brightness?</title>
                        <link>https://forum.dronebotworkshop.com/electronic-components/led-color-vs-led-brightness/#post-12940</link>
                        <pubDate>Wed, 23 Sep 2020 17:58:04 +0000</pubDate>
                        <description><![CDATA[Try my code: 
#include &lt;avr/io.h&gt;#include &lt;util/delay.h&gt;/**Scetch ColorBlend_CommonCathode is a color fade/blend routine for a tri-colorcommon cathode led connected to Arduino U...]]></description>
                        <content:encoded><![CDATA[<p>Try my code: </p>
<p>#include &lt;avr/io.h&gt;<br />#include &lt;util/delay.h&gt;<br />/**<br />Scetch ColorBlend_CommonCathode is a color fade/blend routine for a tri-color<br />common cathode led connected to Arduino Uno digital pins 9, 10, and 11 as PWM<br />outputs. Colors transition from blue through teal, green, yellow, orange, red,<br />violet, purple, and back to blue. With common cathode tri-colored leds,<br />analogWrite() value of 0 results in a full 'off' state, and analogWrite() <br />value of 255 results in a full 'on' state. This scetch works with common<br />anode tri-colored leds, only the color blend runs in the opposite order.<br />Written in Arduino C language.<br />@author Mike Tonge<br />@date 12/03/2019<br />*/<br />// Constants<br />const uint8_t DELAY_TIME = 100; // Delay time (miliseconds)<br />const uint8_t redLED = 9; // Red on digital pin 9<br />const uint8_t grnLED = 10; // Green on digital pin 10<br />const uint8_t bluLED = 11; // Blue on digital pin 11<br />const uint8_t OFF = 0; // Value used to turn led off<br />// Variables<br />uint8_t redVal = 0; // Red value<br />uint8_t grnVal = 0; // Green value<br />uint8_t bluVal = 0; // Blue value</p>
<p>void setup() {<br />pinMode(redLED, OUTPUT); // Set pin 9 as output<br />pinMode(grnLED, OUTPUT); // Set pin 10 as output<br />pinMode(bluLED, OUTPUT); // Set pin 11 as output<br />}</p>
<p>void loop() {<br />for (int count = 0; count &lt;= 765; count++) {<br />switch (count) {<br />// Red is off, Green gets brighter, Blue gets dimmer<br />case 0 ... 255:<br />redVal = OFF;<br />grnVal = count;<br />bluVal = 255 - count;<br />break;<br />// Red gets brighter, Green gets dimmer, Blue is off<br />case 256 ... 510:<br />redVal = count - 255;<br />grnVal = 510 - count;<br />bluVal = OFF;<br />break;<br />// Red gets dimmer, Green is off, Blue gets brighter<br />case 511 ... 765:<br />redVal = 765 - count;<br />grnVal = OFF;<br />bluVal = count - 510;<br />break;<br />default:<br />break;<br />} // End switch<br />analogWrite(redLED, redVal);<br />analogWrite(grnLED, grnVal);<br />analogWrite(bluLED, bluVal);<br />delay(DELAY_TIME);<br />}<br />}</p>]]></content:encoded>
						                            <category domain="https://forum.dronebotworkshop.com/electronic-components/">Electronic Components &amp; Theory</category>                        <dc:creator>ZoolanderMicro</dc:creator>
                        <guid isPermaLink="true">https://forum.dronebotworkshop.com/electronic-components/led-color-vs-led-brightness/#post-12940</guid>
                    </item>
				                    <item>
                        <title>RE: LED color vs. LED brightness?</title>
                        <link>https://forum.dronebotworkshop.com/electronic-components/led-color-vs-led-brightness/#post-12003</link>
                        <pubDate>Thu, 02 Jul 2020 18:12:11 +0000</pubDate>
                        <description><![CDATA[This might let you have a little extra Fun with LEDs...]]></description>
                        <content:encoded><![CDATA[<p>This might let you have a little extra Fun with LEDs...</p>
<p>  <a href="https://www.youtube.com/watch?v=2tphX8scoM8&amp;list=WL&amp;index=2">https://www.youtube.com/watch?v=2tphX8scoM8&amp;list=WL&amp;index=2</a></p>
<p> </p>]]></content:encoded>
						                            <category domain="https://forum.dronebotworkshop.com/electronic-components/">Electronic Components &amp; Theory</category>                        <dc:creator>JoeLyddon</dc:creator>
                        <guid isPermaLink="true">https://forum.dronebotworkshop.com/electronic-components/led-color-vs-led-brightness/#post-12003</guid>
                    </item>
				                    <item>
                        <title>RE: LED color vs. LED brightness?</title>
                        <link>https://forum.dronebotworkshop.com/electronic-components/led-color-vs-led-brightness/#post-11982</link>
                        <pubDate>Sat, 27 Jun 2020 17:54:19 +0000</pubDate>
                        <description><![CDATA[@robotbuilder.   Thanks...that helps me a lot. I’m going to play some more and get my understanding fixed.]]></description>
                        <content:encoded><![CDATA[<p>@robotbuilder.   Thanks...that helps me a lot. I’m going to play some more and get my understanding fixed.</p>]]></content:encoded>
						                            <category domain="https://forum.dronebotworkshop.com/electronic-components/">Electronic Components &amp; Theory</category>                        <dc:creator>GlennStasse</dc:creator>
                        <guid isPermaLink="true">https://forum.dronebotworkshop.com/electronic-components/led-color-vs-led-brightness/#post-11982</guid>
                    </item>
				                    <item>
                        <title>RE: LED color vs. LED brightness?</title>
                        <link>https://forum.dronebotworkshop.com/electronic-components/led-color-vs-led-brightness/#post-11979</link>
                        <pubDate>Fri, 26 Jun 2020 22:13:10 +0000</pubDate>
                        <description><![CDATA[The analog output of the Arduino is turned on (5 volt)) and off (0 volt) at a high frequency called pulse width modulation. The longer the pulse in on the brighter the LED. If you wanted a c...]]></description>
                        <content:encoded><![CDATA[<p>The analog output of the Arduino is turned on (5 volt)) and off (0 volt) at a high frequency called pulse width modulation. The longer the pulse in on the brighter the LED. If you wanted a continuous analog signal you would have to use a digital to analog converter (DAC). You can combine the output from three LEDS each giving off a different wavelength of light such as a red LED, a green LED and a blue LED to make a range of colors.</p>
<p>Each pixel is a different combination of two different LEDS which have been varied between 0 and 255.</p>
1832
<p> </p>
<p> </p>]]></content:encoded>
						                            <category domain="https://forum.dronebotworkshop.com/electronic-components/">Electronic Components &amp; Theory</category>                        <dc:creator>robotBuilder</dc:creator>
                        <guid isPermaLink="true">https://forum.dronebotworkshop.com/electronic-components/led-color-vs-led-brightness/#post-11979</guid>
                    </item>
				                    <item>
                        <title>RE: LED color vs. LED brightness?</title>
                        <link>https://forum.dronebotworkshop.com/electronic-components/led-color-vs-led-brightness/#post-11978</link>
                        <pubDate>Fri, 26 Jun 2020 20:15:34 +0000</pubDate>
                        <description><![CDATA[Well, thanks all for your thoughts. In fact, I have tried a sketch that randomly selects a different value for each color, mostly because I couldn’t think of a way to vary all 3 values unifo...]]></description>
                        <content:encoded><![CDATA[<p>Well, thanks all for your thoughts. In fact, I have tried a sketch that randomly selects a different value for each color, mostly because I couldn’t think of a way to vary all 3 values uniformly. My original thought was to try every possible value and combination thereof just to see what all the colors looked like. I wound up settling for 3 random selections for each loop. That was enough to set me off on this quest. Once I decided intensity, what is apparently varied by setting this value, is not the same as hue, shades of color, I just decided with 3 variables I can make only 8 colors and I wrote a sketch to do that. It’s not very satisfactory looking!</p>
<p>As for the neurological interpretation of color and all that, I’m going to argue a little here. First, I will agree that a typical computer screen with lots of pixels of varying “color” is interpreted by your eye, blended and smoothed, and so forth. But that’s MANY pixels grouped together by your eye. This is ONE LED! (OK, three actually) In essence, one pixel. In my little experiment above you can see each of the colors separately when all 3 were activated. I’m guessing you need some number of LEDs in a group for it to look like some mixed color like lavender or orange. </p>
<p>So I still have this question: What are you actually varying when you change these values? Aren’t you adding more current (or is it voltage?) as you raise the value from 0 to 255? I’m guessing the LED, because of its physical construction, can only give off one frequency of light, or “color” for each internal LED. If so you only get 8 colors, not 16M.</p>
<p>i don’t mean to be argumentative here. Really. And thank you all for your responses!</p>
<p> </p>
<p>glenn</p>]]></content:encoded>
						                            <category domain="https://forum.dronebotworkshop.com/electronic-components/">Electronic Components &amp; Theory</category>                        <dc:creator>GlennStasse</dc:creator>
                        <guid isPermaLink="true">https://forum.dronebotworkshop.com/electronic-components/led-color-vs-led-brightness/#post-11978</guid>
                    </item>
				                    <item>
                        <title>RE: LED color vs. LED brightness?</title>
                        <link>https://forum.dronebotworkshop.com/electronic-components/led-color-vs-led-brightness/#post-11975</link>
                        <pubDate>Fri, 26 Jun 2020 18:36:12 +0000</pubDate>
                        <description><![CDATA[You hook each colour&#039;s pin up to a different output and cycle through colours like this (I haven&#039;t tested it, I just wrote it off the top of my head):
const int redPin = 3;const int greenPi...]]></description>
                        <content:encoded><![CDATA[<p>You hook each colour's pin up to a different output and cycle through colours like this (I haven't tested it, I just wrote it off the top of my head):</p>
<pre>const int redPin = 3;<br /><br />const int greenPin = 5;<br /><br />const int bluePin = 6;<br /><br />int redVal = 0;<br /><br />int greenVal = 0;<br /><br />int blueVal = 0;<br /><br />int redStep = 1;<br /><br />int greenStep = 3;<br /><br />int blueStep = 5;<br /><br />// set pinmode to OUTPUT in the setup() function<br /><br />pinMode(redPin, OUTPUT); // etc<br /><br />void loop() {<br /><br />// output the 3 values to the 3 pins<br /><br />analogWrite(redPin, redVal); // etc<br /><br />// update the values<br /><br />redPin += redStep;<br /><br />if (redStep &gt; 255) {<br /><br />   redStep -= 256;<br /><br />} // same for the other colours.<br /><br /><br /><br />delay(100);</pre>]]></content:encoded>
						                            <category domain="https://forum.dronebotworkshop.com/electronic-components/">Electronic Components &amp; Theory</category>                        <dc:creator>damaru</dc:creator>
                        <guid isPermaLink="true">https://forum.dronebotworkshop.com/electronic-components/led-color-vs-led-brightness/#post-11975</guid>
                    </item>
				                    <item>
                        <title>RE: LED color vs. LED brightness?</title>
                        <link>https://forum.dronebotworkshop.com/electronic-components/led-color-vs-led-brightness/#post-11960</link>
                        <pubDate>Fri, 26 Jun 2020 01:02:34 +0000</pubDate>
                        <description><![CDATA[Posted by: @glennstasse 
I’m a true newbie. Sorry if this question has an obvious answer to most of you. But...
I&#039;m playing around with my Arduino and a 3-color LED. The simple sketch has ...]]></description>
                        <content:encoded><![CDATA[<blockquote data-userid="2478" data-postid="11957" data-mention="glennstasse">
<div class="wpforo-post-quote-author"><strong> Posted by: @glennstasse </strong></div>
<p>I’m a true newbie. Sorry if this question has an obvious answer to most of you. But...</p>
<p>I'm playing around with my Arduino and a 3-color LED. The simple sketch has you varying the BRIGHTNESS of each color between 0 and 255. So that’s basically 8-bit color, right? Except, wait! Does changing those values actually change the “color” (frequency) of the emitted light? Or, does it change the INTENSITY of that light but not the color? I got to thinking about this because I thought it would be an interesting exercise to automate showing all the possible colors (16 million is it?). But I don’t see anything like that. In fact, it looks like there are only 8 variants of colors (3 binary places).</p>
<p> </p>
<p>am I off the beam here?</p>
</blockquote>
<p>Sounds interesting...  Have you tried modifying your sketch by adding a simple: </p>
<p>For i=0 to 255</p>
<p>Output i to LED &amp; delay a little</p>
<p>Next</p>
<p>That would only display 255 colors, etc.   How would you do it for more colors?  Sounds interesting...  Maybe that's what you have already done?</p>
<p> </p>]]></content:encoded>
						                            <category domain="https://forum.dronebotworkshop.com/electronic-components/">Electronic Components &amp; Theory</category>                        <dc:creator>JoeLyddon</dc:creator>
                        <guid isPermaLink="true">https://forum.dronebotworkshop.com/electronic-components/led-color-vs-led-brightness/#post-11960</guid>
                    </item>
							        </channel>
        </rss>
		