<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[RemoteXY community — Button controlling the wrong output pin]]></title>
	<link rel="self" href="https://forum.remotexy.com/extern.php?action=feed&amp;tid=1055&amp;type=atom" />
	<updated>2020-06-16T08:06:51Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.remotexy.com/viewtopic.php?id=1055</id>
		<entry>
			<title type="html"><![CDATA[Button controlling the wrong output pin]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=3082#p3082" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[mcajpx]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=1416</uri>
			</author>
			<updated>2020-06-16T08:06:51Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=3082#p3082</id>
		</entry>
</feed>
