<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[RemoteXY community — 2 relay in one switsh]]></title>
	<link rel="self" href="https://forum.remotexy.com/extern.php?action=feed&amp;tid=885&amp;type=atom" />
	<updated>2020-02-01T11:33:31Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.remotexy.com/viewtopic.php?id=885</id>
		<entry>
			<title type="html"><![CDATA[Re: 2 relay in one switsh]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=2538#p2538" />
			<content type="html"><![CDATA[<p>tnx bro <br />im sory about your crystal ball <br />frind thats messege after update ( exit status 1<br />&#039;struct&lt;unnamed&gt;&#039; has no member named &#039;SWITCH_1&#039;)</p><p>i feel the code from bigining is error<br />i had make alot of change on it<br />please can make afull code <br />i connect the 2 relay on pin 10 and 11<br />blotooth tx rx on pin 2 and 3</p><p>please make full code for me</p><div class="quotebox"><cite>Guillaume wrote:</cite><blockquote><p>Replace RemoteXY.switch with your own variable, my crystal ball is broken so I can&#039;t see what variable name you used...</p></blockquote></div>]]></content>
			<author>
				<name><![CDATA[872564]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=1190</uri>
			</author>
			<updated>2020-02-01T11:33:31Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=2538#p2538</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: 2 relay in one switsh]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=2537#p2537" />
			<content type="html"><![CDATA[<p>Replace RemoteXY.switch with your own variable, my crystal ball is broken so I can&#039;t see what variable name you used...</p>]]></content>
			<author>
				<name><![CDATA[Guillaume]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=23</uri>
			</author>
			<updated>2020-02-01T10:54:34Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=2537#p2537</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: 2 relay in one switsh]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=2536#p2536" />
			<content type="html"><![CDATA[<p>exit status 1<br />expected unqualified-id before &#039;switch&#039;<br /></p><div class="quotebox"><cite>872564 wrote:</cite><blockquote><p>Tnx frind i found an error in complate <br />Please can get me the full surce<br /></p><div class="quotebox"><cite>Guillaume wrote:</cite><blockquote><p>Like this<br /></p><div class="codebox"><pre><code>void loop()
{
    static uint8_t switch_PreviousValue = RemoteXY.switch;

    // if switch value changed
    if ( RemoteXY.switch != switch_PreviousValue )
    {
        digitalWrite( pin_relay1, RemoteXY.switch == 0 ? HIGH : LOW  );
        digitalWrite( pin_relay2, RemoteXY.switch == 0 ? LOW  : HIGH );
        switch_PreviousValue = RemoteXY.switch;
    }
}</code></pre></div><p>Maybe need to invert logic, depending if your relays are Active LOW or Active HIGH.</p></blockquote></div></blockquote></div>]]></content>
			<author>
				<name><![CDATA[872564]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=1190</uri>
			</author>
			<updated>2020-02-01T09:10:00Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=2536#p2536</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: 2 relay in one switsh]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=2532#p2532" />
			<content type="html"><![CDATA[<p>Tnx frind i found an error in complate <br />Please can get me the full surce<br /></p><div class="quotebox"><cite>Guillaume wrote:</cite><blockquote><p>Like this<br /></p><div class="codebox"><pre><code>void loop()
{
    static uint8_t switch_PreviousValue = RemoteXY.switch;

    // if switch value changed
    if ( RemoteXY.switch != switch_PreviousValue )
    {
        digitalWrite( pin_relay1, RemoteXY.switch == 0 ? HIGH : LOW  );
        digitalWrite( pin_relay2, RemoteXY.switch == 0 ? LOW  : HIGH );
        switch_PreviousValue = RemoteXY.switch;
    }
}</code></pre></div><p>Maybe need to invert logic, depending if your relays are Active LOW or Active HIGH.</p></blockquote></div>]]></content>
			<author>
				<name><![CDATA[872564]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=1190</uri>
			</author>
			<updated>2020-01-31T22:22:05Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=2532#p2532</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: 2 relay in one switsh]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=2531#p2531" />
			<content type="html"><![CDATA[<p>Like this<br /></p><div class="codebox"><pre><code>void loop()
{
    static uint8_t switch_PreviousValue = RemoteXY.switch;

    // if switch value changed
    if ( RemoteXY.switch != switch_PreviousValue )
    {
        digitalWrite( pin_relay1, RemoteXY.switch == 0 ? HIGH : LOW  );
        digitalWrite( pin_relay2, RemoteXY.switch == 0 ? LOW  : HIGH );
        switch_PreviousValue = RemoteXY.switch;
    }
}</code></pre></div><p>Maybe need to invert logic, depending if your relays are Active LOW or Active HIGH.</p>]]></content>
			<author>
				<name><![CDATA[Guillaume]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=23</uri>
			</author>
			<updated>2020-01-31T21:49:49Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=2531#p2531</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[2 relay in one switsh]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=2528#p2528" />
			<content type="html"><![CDATA[<p>hi ...<br />I have 2 channel relay modle .. i put in&nbsp; 4 and 5 pin<br />in normaly 2 switch control it</p><p>i need to control it with one switsch .. means if switsh off turn relay number one on <br />and number 2 off , and if switch on turn number one off and turn the number 2 relay</p>]]></content>
			<author>
				<name><![CDATA[872564]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=1190</uri>
			</author>
			<updated>2020-01-31T15:34:31Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=2528#p2528</id>
		</entry>
</feed>
