<?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 Combination control using Arduino - Arduino				            </title>
            <link>https://www.tweaking4all.com/forum/arduino/led-combination-control-using-arduino/</link>
            <description>Tweaking4All.com Discussion Board</description>
            <language>en-US</language>
            <lastBuildDate>Tue, 21 Jul 2026 01:49:52 +0000</lastBuildDate>
            <generator>wpForo</generator>
            <ttl>60</ttl>
							                    <item>
                        <title>RE: LED Combination control using Arduino</title>
                        <link>https://www.tweaking4all.com/forum/arduino/led-combination-control-using-arduino/#post-4111</link>
                        <pubDate>Tue, 12 Apr 2022 08:48:14 +0000</pubDate>
                        <description><![CDATA[I&#039;m not sure what you have in mind, but shorting V and GND is never a good idea. So I would not take that as a viable option to implement.]]></description>
                        <content:encoded><![CDATA[<p>I'm not sure what you have in mind, but shorting V and GND is never a good idea. So I would not take that as a viable option to implement.</p>]]></content:encoded>
						                            <category domain="https://www.tweaking4all.com/forum/arduino/">Arduino</category>                        <dc:creator>Hans</dc:creator>
                        <guid isPermaLink="true">https://www.tweaking4all.com/forum/arduino/led-combination-control-using-arduino/#post-4111</guid>
                    </item>
				                    <item>
                        <title>RE: LED Combination control using Arduino</title>
                        <link>https://www.tweaking4all.com/forum/arduino/led-combination-control-using-arduino/#post-4110</link>
                        <pubDate>Tue, 12 Apr 2022 03:00:26 +0000</pubDate>
                        <description><![CDATA[@hans 
Thank you for your detailed reply.
I am trying to procure WS2812 and will try to control select LEDs using an Arduino UNO.
I was just curious about one thing, if I am able to contr...]]></description>
                        <content:encoded><![CDATA[<p>@hans </p>
<p>Thank you for your detailed reply.</p>
<p>I am trying to procure WS2812 and will try to control select LEDs using an Arduino UNO.</p>
<p>I was just curious about one thing, if I am able to control the switching ON of the required LEDs, more than half of my task is done. Now to reset a particular LED that is glowing, can I just add a tactile switch between the +ve and the GND pins and press it to short the supply to ground which will switch the LED off for that moment and when I release the tact switch, the LED won't glow again in absence of a trigger that initially switched it ON.</p>
<p>In that case, I will not have a feedback to the system to know that the LED is now OFF, which is pretty much okay with me.</p>
<p>So basically if I have a switching ON mechanism in place, I just need to find a way to reset the LED and make it OFF.</p>]]></content:encoded>
						                            <category domain="https://www.tweaking4all.com/forum/arduino/">Arduino</category>                        <dc:creator>Anonymous</dc:creator>
                        <guid isPermaLink="true">https://www.tweaking4all.com/forum/arduino/led-combination-control-using-arduino/#post-4110</guid>
                    </item>
				                    <item>
                        <title>RE: LED Combination control using Arduino</title>
                        <link>https://www.tweaking4all.com/forum/arduino/led-combination-control-using-arduino/#post-4103</link>
                        <pubDate>Thu, 07 Apr 2022 12:17:12 +0000</pubDate>
                        <description><![CDATA[First of all, thanks for making me familiar with the event library - I didn&#039;t know this one existed. 😊 
As for applying this to 60 LEDs ... do you want 60 switches with that as well?
60 LE...]]></description>
                        <content:encoded><![CDATA[<p>First of all, thanks for making me familiar with the event library - I didn't know this one existed. 😊 </p>
<p>As for applying this to 60 LEDs ... do you want 60 switches with that as well?</p>
<p>60 LEDs: I'd start using <a href="https://www.tweaking4all.com/hardware/arduino/arduino-ws2812-led/" target="_blank" rel="noopener">addressable RGB LEDs</a> instead of individual LEDs - like the WS2811 or WS2812.<br />These are available as strips, or "individual" LEDs ... you will be able to <a href="https://amzn.to/3JcVkjP" target="_blank" rel="noopener">get those from Amazon</a> and the look like this:</p>
292
<p> (strips)</p>
294
<p> (individuals)</p>
<p>This way you'd need only one pin for all 60 LEDs (see <a href="https://www.tweaking4all.com/hardware/arduino/arduino-ws2812-led/" target="_blank" rel="noopener">my article on WS2811/WS2812</a>).</p>
<p>If you want 60 buttons as well, then you'll need to look into some kind of <a href="https://www.aranacorp.com/en/using-a-multiplexer-with-arduino/" target="_blank" rel="noopener">multiplexer</a>, so you can connect that many switches.<br />Unfortunately, a matrix won't work - as it would still need too many pins (6x10 = 6+10 = 16 pins needed).<br />My experience with multiplexers and shift-registers is pretty much zero.</p>
<p>You could also try using a regular keyboard (has more than 100 keys, and you could take it apart so you can wire switches to replace the keyboard switches).<br />I found a <a href="https://create.arduino.cc/projecthub/michalin70/connect-a-usb-keyboard-with-an-arduino-50c077?ref=part&amp;ref_id=11332&amp;offset=5" target="_blank" rel="noopener">project that actually allows you to connect a USB keyboard to your Arduino</a>.</p>
<p>Hope this helps ...</p>]]></content:encoded>
						                            <category domain="https://www.tweaking4all.com/forum/arduino/">Arduino</category>                        <dc:creator>Hans</dc:creator>
                        <guid isPermaLink="true">https://www.tweaking4all.com/forum/arduino/led-combination-control-using-arduino/#post-4103</guid>
                    </item>
				                    <item>
                        <title>RE: LED Combination control using Arduino</title>
                        <link>https://www.tweaking4all.com/forum/arduino/led-combination-control-using-arduino/#post-4102</link>
                        <pubDate>Thu, 07 Apr 2022 10:40:42 +0000</pubDate>
                        <description><![CDATA[@hans
What I need to do now is make the logic work for 60 LEDs.
I know it will not be done the same way the code has been written, but can you guide me with something that will work?]]></description>
                        <content:encoded><![CDATA[<p>@hans</p>
<p>What I need to do now is make the logic work for 60 LEDs.</p>
<p>I know it will not be done the same way the code has been written, but can you guide me with something that will work?</p>]]></content:encoded>
						                            <category domain="https://www.tweaking4all.com/forum/arduino/">Arduino</category>                        <dc:creator>Anonymous</dc:creator>
                        <guid isPermaLink="true">https://www.tweaking4all.com/forum/arduino/led-combination-control-using-arduino/#post-4102</guid>
                    </item>
				                    <item>
                        <title>RE: LED Combination control using Arduino</title>
                        <link>https://www.tweaking4all.com/forum/arduino/led-combination-control-using-arduino/#post-4101</link>
                        <pubDate>Thu, 07 Apr 2022 10:39:16 +0000</pubDate>
                        <description><![CDATA[#include &lt; EventButton.h&gt;

EventButton firstButton(9);
EventButton secondButton(2);
EventButton thirdButton(3);
EventButton fourthButton(10);
EventButton fifthButton(11);
int a1...]]></description>
                        <content:encoded><![CDATA[<pre contenteditable="false">#include &lt; EventButton.h&gt;

EventButton firstButton(9);
EventButton secondButton(2);
EventButton thirdButton(3);
EventButton fourthButton(10);
EventButton fifthButton(11);
int a1 = 12;
int a2 = 8;
int a3 = 4;
int a4 = 5;
int a5 = 6;

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  pinMode(a1, OUTPUT);
  pinMode(a2, OUTPUT);
  pinMode(a3, OUTPUT);
  pinMode(a4, OUTPUT);
  pinMode(a5, OUTPUT);

  firstButton.setClickHandler(onFirstButtonClicked);
  secondButton.setClickHandler(onSecondButtonClicked);
  thirdButton.setClickHandler(onThirdButtonClicked);
  fourthButton.setClickHandler(onFourthButtonClicked);
  fifthButton.setClickHandler(onFifthButtonClicked);
}

void loop() {

  char data = Serial.read();
  switch (data) //Selection Control Statement
  {
  case '1':
    digitalWrite(a1, HIGH);
    digitalWrite(a2, HIGH);
    digitalWrite(a4, HIGH);
    break;
  case '2':
    digitalWrite(a1, HIGH);
    digitalWrite(a3, HIGH);
    digitalWrite(a5, HIGH);
    break;
  case '3':
    digitalWrite(a1, HIGH);
    digitalWrite(a2, HIGH);
    digitalWrite(a3, HIGH);
    break;
  case '4':
    digitalWrite(a1, HIGH);
    digitalWrite(a3, HIGH);
    digitalWrite(a4, HIGH);
    break;

  }

  firstButton.update();
  secondButton.update();
  thirdButton.update();
  fourthButton.update();
  fifthButton.update();
}

void onFirstButtonClicked(EventButton &amp; eb) {
  Serial.print("First button clicked ");
  digitalWrite(a1, LOW);
}

void onSecondButtonClicked(EventButton &amp; eb) {
  Serial.print("Second button clicked: ");
  digitalWrite(a2, LOW);
}

void onThirdButtonClicked(EventButton &amp; eb) {
  Serial.print("Third button clicked: ");
  digitalWrite(a3, LOW);
}

void onFourthButtonClicked(EventButton &amp; eb) {
  Serial.print("Fourth button clicked ");
  digitalWrite(a4, LOW);
}

void onFifthButtonClicked(EventButton &amp; eb) {
  Serial.print("Fifth button clicked ");
  digitalWrite(a5, LOW);
}</pre>]]></content:encoded>
						                            <category domain="https://www.tweaking4all.com/forum/arduino/">Arduino</category>                        <dc:creator>Anonymous</dc:creator>
                        <guid isPermaLink="true">https://www.tweaking4all.com/forum/arduino/led-combination-control-using-arduino/#post-4101</guid>
                    </item>
				                    <item>
                        <title>RE: LED Combination control using Arduino</title>
                        <link>https://www.tweaking4all.com/forum/arduino/led-combination-control-using-arduino/#post-4100</link>
                        <pubDate>Thu, 07 Apr 2022 10:36:36 +0000</pubDate>
                        <description><![CDATA[@hans - I tried doing it again but still unable to. Let me see if I can attach a file.]]></description>
                        <content:encoded><![CDATA[<p>@hans - I tried doing it again but still unable to. Let me see if I can attach a file.</p>]]></content:encoded>
						                            <category domain="https://www.tweaking4all.com/forum/arduino/">Arduino</category>                        <dc:creator>Anonymous</dc:creator>
                        <guid isPermaLink="true">https://www.tweaking4all.com/forum/arduino/led-combination-control-using-arduino/#post-4100</guid>
                    </item>
				                    <item>
                        <title>RE: LED Combination control using Arduino</title>
                        <link>https://www.tweaking4all.com/forum/arduino/led-combination-control-using-arduino/#post-4098</link>
                        <pubDate>Thu, 07 Apr 2022 10:00:50 +0000</pubDate>
                        <description><![CDATA[Hi Nikhil_m,
Sorry for the inconvenience ....The forum will not allow posting code or attachments until at least 5 posts have been manually approved - too many people spam forums like this ...]]></description>
                        <content:encoded><![CDATA[<p>Hi Nikhil_m,</p>
<p>Sorry for the inconvenience ....<br />The forum will not allow posting code or attachments until at least 5 posts have been manually approved - too many people spam forums like this and we'd like to prevent that</p>
<p>I think you just managed to get 5 posts 😊 <br />Feel free to try to post the code again. (ideally also attached as an ino file).</p>]]></content:encoded>
						                            <category domain="https://www.tweaking4all.com/forum/arduino/">Arduino</category>                        <dc:creator>Hans</dc:creator>
                        <guid isPermaLink="true">https://www.tweaking4all.com/forum/arduino/led-combination-control-using-arduino/#post-4098</guid>
                    </item>
				                    <item>
                        <title>RE: LED Combination control using Arduino</title>
                        <link>https://www.tweaking4all.com/forum/arduino/led-combination-control-using-arduino/#post-4096</link>
                        <pubDate>Thu, 07 Apr 2022 04:18:13 +0000</pubDate>
                        <description><![CDATA[@hans Thank you for supporting me.
I was able to run the program with desired output.
I took some help from a friend, and we also referred to the reply from you on this thread.
I am tryin...]]></description>
                        <content:encoded><![CDATA[<p>@hans Thank you for supporting me.</p>
<p>I was able to run the program with desired output.</p>
<p>I took some help from a friend, and we also referred to the reply from you on this thread.</p>
<p>I am trying to share the code here but not able to see the reply once I post it.</p>]]></content:encoded>
						                            <category domain="https://www.tweaking4all.com/forum/arduino/">Arduino</category>                        <dc:creator>Anonymous</dc:creator>
                        <guid isPermaLink="true">https://www.tweaking4all.com/forum/arduino/led-combination-control-using-arduino/#post-4096</guid>
                    </item>
				                    <item>
                        <title>RE: LED Combination control using Arduino</title>
                        <link>https://www.tweaking4all.com/forum/arduino/led-combination-control-using-arduino/#post-4095</link>
                        <pubDate>Thu, 07 Apr 2022 04:11:17 +0000</pubDate>
                        <description><![CDATA[@hans I am trying to post the code but unable to do so]]></description>
                        <content:encoded><![CDATA[<p>@hans I am trying to post the code but unable to do so</p>]]></content:encoded>
						                            <category domain="https://www.tweaking4all.com/forum/arduino/">Arduino</category>                        <dc:creator>Anonymous</dc:creator>
                        <guid isPermaLink="true">https://www.tweaking4all.com/forum/arduino/led-combination-control-using-arduino/#post-4095</guid>
                    </item>
				                    <item>
                        <title>RE: LED Combination control using Arduino</title>
                        <link>https://www.tweaking4all.com/forum/arduino/led-combination-control-using-arduino/#post-4078</link>
                        <pubDate>Wed, 30 Mar 2022 09:57:59 +0000</pubDate>
                        <description><![CDATA[Would you mind posting your code? This way I may be able to see what is going wrong ... 😊]]></description>
                        <content:encoded><![CDATA[<p>Would you mind posting your code? This way I may be able to see what is going wrong ... 😊 </p>]]></content:encoded>
						                            <category domain="https://www.tweaking4all.com/forum/arduino/">Arduino</category>                        <dc:creator>Hans</dc:creator>
                        <guid isPermaLink="true">https://www.tweaking4all.com/forum/arduino/led-combination-control-using-arduino/#post-4078</guid>
                    </item>
							        </channel>
        </rss>
		