<?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 controlling the wrong output pin]]></title>
		<link>https://forum.remotexy.com/viewtopic.php?id=1055</link>
		<atom:link href="https://forum.remotexy.com/extern.php?action=feed&amp;tid=1055&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Button controlling the wrong output pin.]]></description>
		<lastBuildDate>Tue, 16 Jun 2020 08:06:51 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Button controlling the wrong output pin]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=3082#p3082</link>
			<description><![CDATA[<p>There must be a simple solution to this. </p><p>My hardware: Arduino Uno, ESP 01, Green LED, Yellow LED</p><p>My RemoteXY App: On/Off Switch Green LED pin 12<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Push button Yellow LED pin 11</p><p>My Problem: the green LED switch works fine, but the push button controls the green LED when it is switched on.</p><p>I have checked all my wiring and code, it should be fine. How is the button, coded for pin 11 controlling a light that is on pin 12? I did not alter the code from what I copied from RemoteXY.</p><p>I was so excited just to get the ESP working talking to my phone, but this has got me totally confused.</p><p>my code:</p><br /><p>// RemoteXY select connection mode and include library<br />#define REMOTEXY_MODE__ESP8266_HARDSERIAL_POINT</p><p>#include &lt;RemoteXY.h&gt;</p><p>// RemoteXY connection settings<br />#define REMOTEXY_SERIAL Serial<br />#define REMOTEXY_SERIAL_SPEED 115200<br />#define REMOTEXY_WIFI_SSID &quot;RemoteXY&quot;<br />#define REMOTEXY_WIFI_PASSWORD &quot;12345678&quot;<br />#define REMOTEXY_SERVER_PORT 6377</p><br /><p>// RemoteXY configurate<br />#pragma pack(push, 1)<br />uint8_t RemoteXY_CONF[] =<br />{ 255, 2, 0, 0, 0, 30, 0, 10, 13, 0,<br />&nbsp; 2, 1, 65, 10, 22, 11, 2, 26, 31, 31,<br />&nbsp; 79, 78, 0, 79, 70, 70, 0, 1, 0, 29,<br />&nbsp; 11, 12, 12, 2, 31, 88, 0<br />};</p><p>// this structure defines all the variables and events of your control interface<br />struct {</p><p>&nbsp; // input variables<br />&nbsp; uint8_t Green; // =1 if switch ON and =0 if OFF<br />&nbsp; uint8_t Yellow; // =1 if button pressed, else =0</p><p>&nbsp; // other variable<br />&nbsp; uint8_t connect_flag;&nbsp; // =1 if wire connected, else =0</p><p>} RemoteXY;<br />#pragma pack(pop)</p><p>/////////////////////////////////////////////<br />//&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;END RemoteXY include&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //<br />/////////////////////////////////////////////</p><p>#define PIN_GREEN 12<br />#define PIN_YELLOW 11</p><br /><p>void setup()<br />{<br />&nbsp; RemoteXY_Init ();</p><p>&nbsp; pinMode (PIN_GREEN, OUTPUT);<br />&nbsp; pinMode (PIN_YELLOW, OUTPUT);</p><p>&nbsp; // TODO you setup code</p><p>}</p><p>void loop()<br />{<br />&nbsp; RemoteXY_Handler ();</p><p>&nbsp; digitalWrite(PIN_GREEN, (RemoteXY.Green == 0) ? LOW : HIGH);<br />&nbsp; digitalWrite(PIN_YELLOW, (RemoteXY.Yellow == 0) ? LOW : HIGH);</p><p>&nbsp; // TODO you loop code<br />&nbsp; // use the RemoteXY structure for data transfer<br />&nbsp; // do not call delay()</p>]]></description>
			<author><![CDATA[null@example.com (mcajpx)]]></author>
			<pubDate>Tue, 16 Jun 2020 08:06:51 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=3082#p3082</guid>
		</item>
	</channel>
</rss>
