<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[RemoteXY community — Switch]]></title>
		<link>https://forum.remotexy.com/viewtopic.php?id=700</link>
		<atom:link href="https://forum.remotexy.com/extern.php?action=feed&amp;tid=700&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Switch.]]></description>
		<lastBuildDate>Fri, 24 Jul 2020 19:24:12 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Switch]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=3226#p3226</link>
			<description><![CDATA[<p>This feature was added recently, see here <a target="_blank" href="http://forum.remotexy.com/viewtopic.php?id=1034">http://forum.remotexy.com/viewtopic.php?id=1034</a></p>]]></description>
			<author><![CDATA[null@example.com (Guillaume)]]></author>
			<pubDate>Fri, 24 Jul 2020 19:24:12 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=3226#p3226</guid>
		</item>
		<item>
			<title><![CDATA[Re: Switch]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=2250#p2250</link>
			<description><![CDATA[<p><img src="https://forum.remotexy.com/img/smilies/sad.png" width="15" height="15" alt="sad" /></p>]]></description>
			<author><![CDATA[null@example.com (Guillaume)]]></author>
			<pubDate>Mon, 24 Jun 2019 06:16:57 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=2250#p2250</guid>
		</item>
		<item>
			<title><![CDATA[Re: Switch]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=2248#p2248</link>
			<description><![CDATA[<div class="quotebox"><cite>Guillaume wrote:</cite><blockquote><p>Sadly it&#039;s not possible... This has been asked and requested many many times since years, and it&#039;s still not possible to do this simple thing.</p></blockquote></div><br /><p>Sigh... I want to do things with RemotXY.&nbsp; I look for the answer&#039;s and so often I find you saying this.&nbsp; Guillaume, to you have a document of can&#039;t do with RemoteXY?&nbsp; LOL.</p><p>Seriously this is such a great app, but the limitations like not being able to turn a switch back off from the sketch, or not getting a flag sent to the sketch on page change...</p>]]></description>
			<author><![CDATA[null@example.com (quietfire)]]></author>
			<pubDate>Mon, 24 Jun 2019 00:03:18 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=2248#p2248</guid>
		</item>
		<item>
			<title><![CDATA[Re: Switch]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=2114#p2114</link>
			<description><![CDATA[<div class="quotebox"><cite>Guillaume wrote:</cite><blockquote><p>Sometimes I like to do an action when the button is released so I have the habit of using my method, but yours is nice too if you don&#039;t care about releasing <img src="https://forum.remotexy.com/img/smilies/tongue.png" width="15" height="15" alt="tongue" /></p></blockquote></div><p>It is a shame that the app doesn&#039;t emulate a &quot;proper&quot; touch-screen interface, so that you can do &quot;mouse-down&quot;, &quot;mouse-over&quot;, and &quot;mouse-up&quot; etc.</p><p>Since it is a simple button, with only two states &quot;down&quot; and &quot;up&quot;, and there&#039;s no getting away from that. So, yes, if you want &quot;button-up&quot; you have to do it in code, like your suggestion.&nbsp; But without the intelligence in the app, if you press a button and change your mind, you cannot just drag your finger off the button and take your finger off the screen, like you can with a mouse.</p>]]></description>
			<author><![CDATA[null@example.com (Daba)]]></author>
			<pubDate>Tue, 23 Apr 2019 11:23:56 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=2114#p2114</guid>
		</item>
		<item>
			<title><![CDATA[Re: Switch]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=2091#p2091</link>
			<description><![CDATA[<p>Sometimes I like to do an action when the button is released so I have the habit of using my method, but yours is nice too if you don&#039;t care about releasing <img src="https://forum.remotexy.com/img/smilies/tongue.png" width="15" height="15" alt="tongue" /></p>]]></description>
			<author><![CDATA[null@example.com (Guillaume)]]></author>
			<pubDate>Wed, 17 Apr 2019 19:41:40 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=2091#p2091</guid>
		</item>
		<item>
			<title><![CDATA[Re: Switch]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=2088#p2088</link>
			<description><![CDATA[<div class="quotebox"><cite>Guillaume wrote:</cite><blockquote><p>Another trick is to put a Button with no text, then on top of it you put a Text String. You will be able to press the Button even if there is a Text String above it. Then you update the Text String according to the state of the light.</p><p>For example:<br /></p><div class="codebox"><pre><code>// In setup, after RemoteXY_Init() :
strcpy( RemoteXY.textButtonLight, &quot;ON&quot; );

//In loop() :
static uint8_t buttonLight_previousValue = RemoteXY.buttonLight;
static bool lightState = false;
if ( RemoteXY.buttonLight != buttonLight_previousValue )
{
  buttonLight_previousValue = RemoteXY.buttonLight;
      
  if ( RemoteXY.buttonLight == 1 )
  {
    lightState = !lightState;
    strcpy( RemoteXY.textButtonLight, lightState == true ? (&quot;OFF&quot;) : (&quot;ON&quot;) );
    digitalWrite( PIN_LIGHT, lightState == true ? HIGH : LOW );
  }
}</code></pre></div></blockquote></div><p>I have done similar, but I have found that you don&#039;t need to remember &quot;xxx_previousValue&quot; if you immediately write the RemoteXY input OFF as soon as you see it ON, RemoteXY interface can write it OFF again later, but it will have no effect.&nbsp; This creates a&quot;one-shot&quot; effect that works a treat.</p><p>Your code could be simplified to ....</p><div class="codebox"><pre><code>// In setup, after RemoteXY_Init() :
strcpy( RemoteXY.textButtonLight, &quot;ON&quot; );

//In loop() :
if (RemoteXY.buttonLight)  // evaluates as &quot;true&quot; if non-zero
{
  RemoteXY.buttonLight = 0;
  lightState = !lightState;   // invert the lightstate
  strcpy( RemoteXY.textButtonLight, lightState == true ? (&quot;OFF&quot;) : (&quot;ON&quot;) );
  digitalWrite( PIN_LIGHT, lightState);
  }
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Daba)]]></author>
			<pubDate>Wed, 17 Apr 2019 19:25:32 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=2088#p2088</guid>
		</item>
		<item>
			<title><![CDATA[Re: Switch]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=2081#p2081</link>
			<description><![CDATA[<p>Another trick is to put a Button with no text, then on top of it you put a Text String. You will be able to press the Button even if there is a Text String above it. Then you update the Text String according to the state of the light.</p><p>For example:<br /></p><div class="codebox"><pre><code>// In setup, after RemoteXY_Init() :
strcpy( RemoteXY.textButtonLight, &quot;ON&quot; );

//In loop() :
static uint8_t buttonLight_previousValue = RemoteXY.buttonLight;
static bool lightState = false;
if ( RemoteXY.buttonLight != buttonLight_previousValue )
{
  buttonLight_previousValue = RemoteXY.buttonLight;
      
  if ( RemoteXY.buttonLight == 1 )
  {
    lightState = !lightState;
    strcpy( RemoteXY.textButtonLight, lightState == true ? (&quot;OFF&quot;) : (&quot;ON&quot;) );
    digitalWrite( PIN_LIGHT, lightState == true ? HIGH : LOW );
  }
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Guillaume)]]></author>
			<pubDate>Mon, 15 Apr 2019 03:57:05 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=2081#p2081</guid>
		</item>
		<item>
			<title><![CDATA[Re: Switch]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=2077#p2077</link>
			<description><![CDATA[<p>Maybe you know already, but what you can do instead is to have two Buttons On and Off, and a Led or Text indicator to show the actual status of the light.</p>]]></description>
			<author><![CDATA[null@example.com (Guillaume)]]></author>
			<pubDate>Sat, 13 Apr 2019 18:40:14 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=2077#p2077</guid>
		</item>
		<item>
			<title><![CDATA[Re: Switch]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=2076#p2076</link>
			<description><![CDATA[<p><strong>Thanks for your nice response</strong></p>]]></description>
			<author><![CDATA[null@example.com (3dnour)]]></author>
			<pubDate>Sat, 13 Apr 2019 16:00:58 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=2076#p2076</guid>
		</item>
		<item>
			<title><![CDATA[Re: Switch]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=2075#p2075</link>
			<description><![CDATA[<p>Edit: see below</p>]]></description>
			<author><![CDATA[null@example.com (Guillaume)]]></author>
			<pubDate>Sat, 13 Apr 2019 15:48:41 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=2075#p2075</guid>
		</item>
		<item>
			<title><![CDATA[Switch]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=2063#p2063</link>
			<description><![CDATA[<p><strong>welcome everybody ......</strong></p><p><strong>I&#039;m working on NodeMCU V3</strong></p><p><strong>How can I add an external key to the light with the application RemoteXY<br />On the mobile so that I can turn on and turn off the light by mobile<br />  At the same time I want to turn on and off the light through an external key<br />  And know the status of the key in mobile ..</strong></p><br /><p><strong>I wish you all the health........ <img src="https://forum.remotexy.com/img/smilies/smile.png" width="15" height="15" alt="smile" /></strong></p><br /><p><strong>  Thanks</strong></p>]]></description>
			<author><![CDATA[null@example.com (3dnour)]]></author>
			<pubDate>Thu, 11 Apr 2019 08:43:59 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=2063#p2063</guid>
		</item>
	</channel>
</rss>
