<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[RemoteXY community — Button - changes color and text,  Text changes color]]></title>
		<link>https://forum.remotexy.com/viewtopic.php?id=1021</link>
		<atom:link href="https://forum.remotexy.com/extern.php?action=feed&amp;tid=1021&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Button - changes color and text,  Text changes color.]]></description>
		<lastBuildDate>Mon, 25 May 2020 06:14:05 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Button - changes color and text,  Text changes color]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=3010#p3010</link>
			<description><![CDATA[<p>That has nothing to do with bouncing. You can write 0 to the button variable, or detect state changes, see here for example<br /><a target="_blank" href="http://forum.remotexy.com/viewtopic.php?pid=2081#p2081">http://forum.remotexy.com/viewtopic.php?pid=2081#p2081</a></p><p>Bouncing is when you press a physical button, it doesn&#039;t go straight to desired value, there are mechanical properties that makes the voltage be anything between 0 and VCC for a short period of time, like a spring bouncing on the ground, until the voltage is stable enough to be trusted as a digital HIGH or LOW.</p><p><a target="_blank" href="https://en.wikipedia.org/wiki/Switch#Contact_bounce">https://en.wikipedia.org/wiki/Switch#Contact_bounce</a></p><p>This &quot;metro&quot; is simply a delay</p>]]></description>
			<author><![CDATA[null@example.com (Guillaume)]]></author>
			<pubDate>Mon, 25 May 2020 06:14:05 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=3010#p3010</guid>
		</item>
		<item>
			<title><![CDATA[Re: Button - changes color and text,  Text changes color]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=3008#p3008</link>
			<description><![CDATA[<div class="quotebox"><cite>Guillaume wrote:</cite><blockquote><p>Debouncing is for physical (analog) buttons, you don&#039;t need to do any debouncing with virtual (digital) buttons <img src="https://forum.remotexy.com/img/smilies/smile.png" width="15" height="15" alt="smile" /></p></blockquote></div><p>Yes you do.&nbsp; as long as you touch the button on the screen, the variable is a one. It is required to avoid double or triple events.</p>]]></description>
			<author><![CDATA[null@example.com (chrismolloy)]]></author>
			<pubDate>Mon, 25 May 2020 00:52:56 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=3008#p3008</guid>
		</item>
		<item>
			<title><![CDATA[Re: Button - changes color and text,  Text changes color]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=2996#p2996</link>
			<description><![CDATA[<p>Debouncing is for physical (analog) buttons, you don&#039;t need to do any debouncing with virtual (digital) buttons <img src="https://forum.remotexy.com/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></description>
			<author><![CDATA[null@example.com (Guillaume)]]></author>
			<pubDate>Sat, 23 May 2020 08:26:55 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=2996#p2996</guid>
		</item>
		<item>
			<title><![CDATA[Re: Button - changes color and text,  Text changes color]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=2993#p2993</link>
			<description><![CDATA[<p>The sketch uses the Metro timer library which is used to debounce the button.<br />Library is here:<br /></p><div class="codebox"><pre><code> https://github.com/thomasfredericks/Metro-Arduino-Wiring</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (chrismolloy)]]></author>
			<pubDate>Sat, 23 May 2020 05:27:18 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=2993#p2993</guid>
		</item>
		<item>
			<title><![CDATA[Button - changes color and text,  Text changes color]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=2992#p2992</link>
			<description><![CDATA[<p>This is an example of a button with changing text and color, as well as text that changes color.<br />This works by having text on top of an led on top of a button.&nbsp; The button still works, the text displays on the led.</p><p>Overlapping different colored text elements, setting one to&quot;&quot; and the other to&quot;whatever&quot; does the trick!</p><p><span class="postimg"><img src="https://i.imgur.com/fXeBmgP.jpg" alt="https://i.imgur.com/fXeBmgP.jpg" /></span></p><p>here is a link to the screen design</p><p><a target="_blank" href="http://remotexy.com/en/editor/da5d996ac314ef58794b08a0035cd84c/">http://remotexy.com/en/editor/da5d996ac … 0035cd84c/</a></p><p>here is the code just change the screen design for your processor, download and replace the code from the beginning up to and including and replace in this code.</p><div class="codebox"><pre><code>/*
   -- Led toggle button with text --

   This source code of graphical user interface
   has been generated automatically by RemoteXY editor.
   To compile this code using RemoteXY library 2.4.3 or later version
   download by link http://remotexy.com/en/library/
   To connect using RemoteXY mobile app by link http://remotexy.com/en/download/
     - for ANDROID 4.5.1 or later version;
     - for iOS 1.4.1 or later version;

   This source code is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2.1 of the License, or (at your option) any later version.
*/

//////////////////////////////////////////////
//        RemoteXY include library          //
//////////////////////////////////////////////

// RemoteXY select connection mode and include library 
#define REMOTEXY_MODE__ESP8266WIFI_LIB_POINT
#include &lt;ESP8266WiFi.h&gt;

#include &lt;RemoteXY.h&gt;

// RemoteXY connection settings 
#define REMOTEXY_WIFI_SSID &quot;RemoteXY&quot;
#define REMOTEXY_WIFI_PASSWORD &quot;12345678&quot;
#define REMOTEXY_SERVER_PORT 6377


// RemoteXY configurate  
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
{ 255,1,0,55,0,71,0,10,8,0,
67,0,50,22,41,7,135,26,21,67,
0,50,22,41,7,37,26,21,1,1,
8,20,34,11,2,31,0,65,46,7,
20,36,11,129,0,30,6,40,4,94,
87,65,82,72,69,65,68,32,65,67,
84,73,86,65,84,73,79,78,0,67,
1,10,23,31,5,8,26,11 };

// this structure defines all the variables and events of your control interface 
struct {

    // input variables
    uint8_t button_1; // =1 if button pressed, else =0 

      // output variables
    char disarmed_text[21];  // string UTF8 end zero 
    char armed_text[21];  // string UTF8 end zero 
    uint8_t led_1_r; // =0..255 LED Red brightness 
    uint8_t led_1_g; // =0..255 LED Green brightness 
    char button_text[11];  // string UTF8 end zero 

      // other variable
    uint8_t connect_flag;  // =1 if wire connected, else =0 

} RemoteXY;
#pragma pack(pop)


/////////////////////////////////////////////
//           END RemoteXY include          //
/////////////////////////////////////////////

#define PIN_BUTTON_1 13

#include &lt;Metro.h&gt;
Metro debounce =  Metro(300);

void setup()
{
    RemoteXY_Init();

    pinMode(PIN_BUTTON_1, OUTPUT);
    RemoteXY.led_1_r = 255;
    strcpy(RemoteXY.button_text, &quot;DIS-ARMED&quot;);
    strcpy(RemoteXY.disarmed_text, &quot;NUCLEAR WARHEAD&quot;);
    strcpy(RemoteXY.armed_text, &quot;&quot;);
    


    // TODO you setup code
    debounce.reset();
}

void loop()
{
    RemoteXY_Handler();

    if (RemoteXY.button_1 == 1)
        if (debounce.check()) {
            if (RemoteXY.led_1_g &gt; 0)
            {
                RemoteXY.led_1_g = 0;
                RemoteXY.led_1_r = 255;
                strcpy(RemoteXY.button_text, &quot;DIS-ARMED&quot;);
                strcpy(RemoteXY.disarmed_text, &quot;NUCLEAR WARHEAD&quot;);
                strcpy(RemoteXY.armed_text, &quot;&quot;);
            }
            else
            {
                RemoteXY.led_1_g = 255;
                RemoteXY.led_1_r = 0;
                strcpy(RemoteXY.button_text, &quot;ARMED&quot;);
                strcpy(RemoteXY.armed_text, &quot;NUCLEAR WARHEAD&quot;);
                strcpy(RemoteXY.disarmed_text, &quot;&quot;);
            }
            debounce.reset();
        }

    // TODO you loop code
    // use the RemoteXY structure for data transfer
    // do not call delay() 


}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (chrismolloy)]]></author>
			<pubDate>Sat, 23 May 2020 05:10:30 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=2992#p2992</guid>
		</item>
	</channel>
</rss>
