<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[RemoteXY community — Switch]]></title>
	<link rel="self" href="https://forum.remotexy.com/extern.php?action=feed&amp;tid=700&amp;type=atom" />
	<updated>2020-07-24T19:24:12Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.remotexy.com/viewtopic.php?id=700</id>
		<entry>
			<title type="html"><![CDATA[Re: Switch]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=3226#p3226" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[Guillaume]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=23</uri>
			</author>
			<updated>2020-07-24T19:24:12Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=3226#p3226</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Switch]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=2250#p2250" />
			<content type="html"><![CDATA[<p><img src="https://forum.remotexy.com/img/smilies/sad.png" width="15" height="15" alt="sad" /></p>]]></content>
			<author>
				<name><![CDATA[Guillaume]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=23</uri>
			</author>
			<updated>2019-06-24T06:16:57Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=2250#p2250</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Switch]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=2248#p2248" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[quietfire]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=611</uri>
			</author>
			<updated>2019-06-24T00:03:18Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=2248#p2248</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Switch]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=2114#p2114" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[Daba]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=630</uri>
			</author>
			<updated>2019-04-23T11:23:56Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=2114#p2114</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Switch]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=2091#p2091" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[Guillaume]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=23</uri>
			</author>
			<updated>2019-04-17T19:41:40Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=2091#p2091</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Switch]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=2088#p2088" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[Daba]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=630</uri>
			</author>
			<updated>2019-04-17T19:25:32Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=2088#p2088</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Switch]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=2081#p2081" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[Guillaume]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=23</uri>
			</author>
			<updated>2019-04-15T03:57:05Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=2081#p2081</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Switch]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=2077#p2077" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[Guillaume]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=23</uri>
			</author>
			<updated>2019-04-13T18:40:14Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=2077#p2077</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Switch]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=2076#p2076" />
			<content type="html"><![CDATA[<p><strong>Thanks for your nice response</strong></p>]]></content>
			<author>
				<name><![CDATA[3dnour]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=869</uri>
			</author>
			<updated>2019-04-13T16:00:58Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=2076#p2076</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Switch]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=2075#p2075" />
			<content type="html"><![CDATA[<p>Edit: see below</p>]]></content>
			<author>
				<name><![CDATA[Guillaume]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=23</uri>
			</author>
			<updated>2019-04-13T15:48:41Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=2075#p2075</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Switch]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=2063#p2063" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[3dnour]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=869</uri>
			</author>
			<updated>2019-04-11T08:43:59Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=2063#p2063</id>
		</entry>
</feed>
