<?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>
									Adding a second button for reverse Arduino all led strips effect - Arduino				            </title>
            <link>https://www.tweaking4all.com/forum/arduino/adding-a-second-button-for-reverse-arduino-all-led-strips-effect/</link>
            <description>Tweaking4All.com Discussion Board</description>
            <language>en-US</language>
            <lastBuildDate>Sun, 10 May 2026 02:24:06 +0000</lastBuildDate>
            <generator>wpForo</generator>
            <ttl>60</ttl>
							                    <item>
                        <title>RE: Adding a second button for reverse Arduino all led strips effect</title>
                        <link>https://www.tweaking4all.com/forum/arduino/adding-a-second-button-for-reverse-arduino-all-led-strips-effect/paged/2/#post-2956</link>
                        <pubDate>Mon, 21 Dec 2020 10:30:59 +0000</pubDate>
                        <description><![CDATA[Excellent! Glad to hear that. 👍 
If you&#039;d like (not required), would you mind posting the result and maybe a little bit of the wiring you did?Again: not required, but it may be helpful for ...]]></description>
                        <content:encoded><![CDATA[<p>Excellent! Glad to hear that. 👍 </p>
<p>If you'd like (not required), would you mind posting the result and maybe a little bit of the wiring you did?<br />Again: not required, but it may be helpful for others 😊 </p>
<p>Either way; glad to hear it works, thanks again for the coffee and enjoy the holidays! 😉 </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/adding-a-second-button-for-reverse-arduino-all-led-strips-effect/paged/2/#post-2956</guid>
                    </item>
				                    <item>
                        <title>RE: Adding a second button for reverse Arduino all led strips effect</title>
                        <link>https://www.tweaking4all.com/forum/arduino/adding-a-second-button-for-reverse-arduino-all-led-strips-effect/paged/2/#post-2955</link>
                        <pubDate>Mon, 21 Dec 2020 10:14:03 +0000</pubDate>
                        <description><![CDATA[i did get the second button working as well ,  there was a   (     missing in a part of the code
 
end good , all good]]></description>
                        <content:encoded><![CDATA[<p>i did get the second button working as well ,  there was a   (     missing in a part of the code</p>
<p> </p>
<p>end good , all good</p>
<p> </p>
<p> </p>]]></content:encoded>
						                            <category domain="https://www.tweaking4all.com/forum/arduino/">Arduino</category>                        <dc:creator>bartie1967</dc:creator>
                        <guid isPermaLink="true">https://www.tweaking4all.com/forum/arduino/adding-a-second-button-for-reverse-arduino-all-led-strips-effect/paged/2/#post-2955</guid>
                    </item>
				                    <item>
                        <title>RE: Adding a second button for reverse Arduino all led strips effect</title>
                        <link>https://www.tweaking4all.com/forum/arduino/adding-a-second-button-for-reverse-arduino-all-led-strips-effect/paged/2/#post-2947</link>
                        <pubDate>Sat, 19 Dec 2020 21:37:21 +0000</pubDate>
                        <description><![CDATA[Awesome Bart! Excellent to hear you&#039;ve got it working 😊 
Let me know whenever you have questions ... ideally through the forum though, so others can learn from it as well 😉 
Merry Christma...]]></description>
                        <content:encoded><![CDATA[<p>Awesome Bart! Excellent to hear you've got it working 😊 </p>
<p>Let me know whenever you have questions ... ideally through the forum though, so others can learn from it as well 😉 </p>
<p>Merry Christmas, and a Happy New Year - hope your daughter is excited about the gift 😉  👍 </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/adding-a-second-button-for-reverse-arduino-all-led-strips-effect/paged/2/#post-2947</guid>
                    </item>
				                    <item>
                        <title>RE: Adding a second button for reverse Arduino all led strips effect</title>
                        <link>https://www.tweaking4all.com/forum/arduino/adding-a-second-button-for-reverse-arduino-all-led-strips-effect/#post-2946</link>
                        <pubDate>Sat, 19 Dec 2020 18:54:58 +0000</pubDate>
                        <description><![CDATA[found it
 
#define BRIGHTNESS 100]]></description>
                        <content:encoded><![CDATA[<p>found it</p>
<p> </p>
<p>#define BRIGHTNESS 100</p>]]></content:encoded>
						                            <category domain="https://www.tweaking4all.com/forum/arduino/">Arduino</category>                        <dc:creator>bartie1967</dc:creator>
                        <guid isPermaLink="true">https://www.tweaking4all.com/forum/arduino/adding-a-second-button-for-reverse-arduino-all-led-strips-effect/#post-2946</guid>
                    </item>
				                    <item>
                        <title>RE: Adding a second button for reverse Arduino all led strips effect</title>
                        <link>https://www.tweaking4all.com/forum/arduino/adding-a-second-button-for-reverse-arduino-all-led-strips-effect/#post-2945</link>
                        <pubDate>Sat, 19 Dec 2020 18:20:32 +0000</pubDate>
                        <description><![CDATA[Hand
 
just one more question

 
 
can you add a brightness function to the entire sketch please ?
Is it a big job to do one with a potentiometer?
if it&#039;s to much work just a setting...]]></description>
                        <content:encoded><![CDATA[<p>Hand</p>
<p> </p>
<p>just one more question</p>
136
<p> </p>
<p> </p>
<p>can you add a brightness function to the entire sketch please ?</p>
<p>Is it a big job to do one with a potentiometer?</p>
<p>if it's to much work just a setting in the sketch</p>]]></content:encoded>
						                            <category domain="https://www.tweaking4all.com/forum/arduino/">Arduino</category>                        <dc:creator>bartie1967</dc:creator>
                        <guid isPermaLink="true">https://www.tweaking4all.com/forum/arduino/adding-a-second-button-for-reverse-arduino-all-led-strips-effect/#post-2945</guid>
                    </item>
				                    <item>
                        <title>RE: Adding a second button for reverse Arduino all led strips effect</title>
                        <link>https://www.tweaking4all.com/forum/arduino/adding-a-second-button-for-reverse-arduino-all-led-strips-effect/#post-2943</link>
                        <pubDate>Sat, 19 Dec 2020 15:32:06 +0000</pubDate>
                        <description><![CDATA[@hans
You have been a big help Hans . I&#039;m not gonna tweak it anymore or ask questions , because i can&#039;t get all the new features in the sketch  at work without errors.
My daughter is gonna...]]></description>
                        <content:encoded><![CDATA[<p>@hans</p>
<p>You have been a big help Hans . I'm not gonna tweak it anymore or ask questions , because i can't get all the new features in the sketch  at work without errors.</p>
<p>My daughter is gonna be happy , and I think dad is a little to picky . Maybe I just want stuff in the sketch that she will never use .</p>
<p>I will try to install it on a ESP8266 in the future .</p>
<p> </p>
<p>Happy holidays and keep save</p>
<p> </p>
<p> </p>]]></content:encoded>
						                            <category domain="https://www.tweaking4all.com/forum/arduino/">Arduino</category>                        <dc:creator>bartie1967</dc:creator>
                        <guid isPermaLink="true">https://www.tweaking4all.com/forum/arduino/adding-a-second-button-for-reverse-arduino-all-led-strips-effect/#post-2943</guid>
                    </item>
				                    <item>
                        <title>RE: Adding a second button for reverse Arduino all led strips effect</title>
                        <link>https://www.tweaking4all.com/forum/arduino/adding-a-second-button-for-reverse-arduino-all-led-strips-effect/#post-2941</link>
                        <pubDate>Sat, 19 Dec 2020 11:09:13 +0000</pubDate>
                        <description><![CDATA[Coming back to your email:
The ESP8266 is in essence an Arduino on steroids ... faster, smaller, more memory, etc.
Using the WiFi part is optional. If you prefer to use a button and an RF ...]]></description>
                        <content:encoded><![CDATA[<p>Coming back to your email:</p>
<p>The ESP8266 is in essence an Arduino on steroids ... faster, smaller, more memory, etc.</p>
<p>Using the WiFi part is optional. If you prefer to use a button and an RF switch, like you did with your Arduino, then you do not need to use the WiFi feature.</p>
<p>If you do want to use the WiFi option, then yes one of the methods to control the lights (for example) would be through a web-interface (call it a "mini website").<br />You will however have to provide the "content" for this yourself.<br />This can be by sending text (see the <a href="https://www.tweaking4all.com/hardware/esp8266/getting-started-esp8266/" target="true">ESP8266 example</a>) we can send through the server as a response to a request from the client (computer, cellphone, tablet, etc).</p>
<p>Another, more complex, approach is by using a SPIFFS file system on the flash part of an ESP8266. This would allow you to store actual text files and such on the ESP8266.<br />I would not recommend this method until you're more familiar with the ins and outs of Arduino programming and especially the technical features of the ESP8266.<br /><a href="https://randomnerdtutorials.com/esp8266-web-server-spiffs-nodemcu/" target="true">Here an article that describes this</a>. Again: not for beginners. 😉 </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/adding-a-second-button-for-reverse-arduino-all-led-strips-effect/#post-2941</guid>
                    </item>
				                    <item>
                        <title>RE: Adding a second button for reverse Arduino all led strips effect</title>
                        <link>https://www.tweaking4all.com/forum/arduino/adding-a-second-button-for-reverse-arduino-all-led-strips-effect/#post-2940</link>
                        <pubDate>Sat, 19 Dec 2020 11:01:46 +0000</pubDate>
                        <description><![CDATA[Posted by: @bartie1967 
this gives me a error
backup:193:3: error: &#039;lastPressed&#039; was not declared in this scopelastPressed = millis();^~~~~~~~~~~exit status 1expected identifier before &#039;(&#039;...]]></description>
                        <content:encoded><![CDATA[<blockquote data-userid="4421" data-postid="2936" data-mention="bartie1967">
<div class="wpforo-post-quote-author"><strong> Posted by: @bartie1967 </strong></div>
<p>this gives me a error</p>
<p>backup:193:3: error: 'lastPressed' was not declared in this scope<br />lastPressed = millis();<br />^~~~~~~~~~~<br />exit status 1<br />expected identifier before '(' token</p>
</blockquote>
<p>My first guess: It looks like I may have made a typo in this line (which can be found in <strong>changeEffect</strong> and <strong>changeEffect2</strong>):</p>
<pre>if <span style="color: #ff0000">(</span>digitalRead <span style="color: #0000ff">(</span>BUTTON2<span style="color: #0000ff">)</span> == HIGH<span style="color: #ff0000">)</span> &amp;&amp; <span style="color: #ff0000">(</span> lastPressed + bounceDelay &lt; millis<span style="color: #0000ff">()</span> <span style="color: #ff0000">)</span> <span style="color: #800000"><strong>)</strong></span> {<br />                                                    <span style="color: #339966">woopsie one ")" too many --^</span></pre>
<p>which should be</p>
<pre>if (digitalRead (BUTTON2) == HIGH) &amp;&amp; ( lastPressed + bounceDelay &lt; millis() ) {</pre>
<p>Error messages can be quite confusing. When looking at this one it tells me initially that "lastPressed" was not defined. Since I assume you added this line at the beginning, this seem odd:</p>
<pre>unsigned long lastPressed = 0;  // last time the button was pressed in milliseconds</pre>
<p>Right after that the error indicates an error with the round bracket "(" and ")", so I looked at that line an noticed I had typed one ")" too many.</p>
<p>Unfortunately, the code you  posted is not the one with the error, since the error points to line 193, which looks different in the code you attached.</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/adding-a-second-button-for-reverse-arduino-all-led-strips-effect/#post-2940</guid>
                    </item>
				                    <item>
                        <title>RE: Adding a second button for reverse Arduino all led strips effect</title>
                        <link>https://www.tweaking4all.com/forum/arduino/adding-a-second-button-for-reverse-arduino-all-led-strips-effect/#post-2937</link>
                        <pubDate>Fri, 18 Dec 2020 13:42:33 +0000</pubDate>
                        <description><![CDATA[here is the code i made .
 
The buttons also give me an error]]></description>
                        <content:encoded><![CDATA[<p>here is the code i made .</p>
<p> </p>
<p>The buttons also give me an error</p>
134
<p> </p>]]></content:encoded>
						                            <category domain="https://www.tweaking4all.com/forum/arduino/">Arduino</category>                        <dc:creator>bartie1967</dc:creator>
                        <guid isPermaLink="true">https://www.tweaking4all.com/forum/arduino/adding-a-second-button-for-reverse-arduino-all-led-strips-effect/#post-2937</guid>
                    </item>
				                    <item>
                        <title>RE: Adding a second button for reverse Arduino all led strips effect</title>
                        <link>https://www.tweaking4all.com/forum/arduino/adding-a-second-button-for-reverse-arduino-all-led-strips-effect/#post-2936</link>
                        <pubDate>Fri, 18 Dec 2020 12:23:32 +0000</pubDate>
                        <description><![CDATA[Posted by: @hans 
void changeEffect() {if (digitalRead (BUTTON) == HIGH) &amp;&amp; ( lastPressed + bounceDelay &lt; millis() ) ) {lastPressed = millis();selectedEffect++;EEPROM.put(0, sele...]]></description>
                        <content:encoded><![CDATA[<blockquote data-userid="1" data-postid="2935" data-mention="hans">
<div class="wpforo-post-quote-author"><strong> Posted by: @hans </strong></div>
<p>void changeEffect() {<br />if (digitalRead (BUTTON) == HIGH) &amp;&amp; ( lastPressed + bounceDelay &lt; millis() ) ) {<br />lastPressed = millis();<br />selectedEffect++;<br />EEPROM.put(0, selectedEffect);<br />asm volatile (" jmp 0");<br />} <br />lastPressed = millis();<br />}</p>
</blockquote>
<p>this gives me a error <br /><br />backup:193:3: error: 'lastPressed' was not declared in this scope<br />lastPressed = millis();<br />^~~~~~~~~~~<br />exit status 1<br />expected identifier before '(' token</p>
<p> </p>
<p>Yep , case 0 now displays correct....... Thx Hans</p>
<p> </p>
<p>the 2 nd buttons I need to check later today ....</p>]]></content:encoded>
						                            <category domain="https://www.tweaking4all.com/forum/arduino/">Arduino</category>                        <dc:creator>bartie1967</dc:creator>
                        <guid isPermaLink="true">https://www.tweaking4all.com/forum/arduino/adding-a-second-button-for-reverse-arduino-all-led-strips-effect/#post-2936</guid>
                    </item>
							        </channel>
        </rss>
		