<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[RemoteXY community — Can I use Switch to develop some logic and not control a pin?]]></title>
	<link rel="self" href="https://forum.remotexy.com/extern.php?action=feed&amp;tid=558&amp;type=atom" />
	<updated>2018-08-19T09:28:55Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.remotexy.com/viewtopic.php?id=558</id>
		<entry>
			<title type="html"><![CDATA[Re: Can I use Switch to develop some logic and not control a pin?]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=1758#p1758" />
			<content type="html"><![CDATA[<p>In actual fact, I never use &quot;Snap to pin&quot; at all because if adds the following lines into your code areas...</p><p>#define PIN_switch_1 8&nbsp; &nbsp;// pin number you have &quot;snapped to&quot;</p><p>in Setup :&nbsp; pinMode (PIN_switch_1, OUTPUT);</p><p>in loop() :&nbsp; digitalWrite(PIN_switch_1, (RemoteXY.switch_1==0)?LOW:HIGH);</p><p>... which makes it a &quot;permanent&quot; snap. There may be times when you don&#039;t want the switch to control the pin, so I prefer to create my own control code.</p>]]></content>
			<author>
				<name><![CDATA[Daba]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=630</uri>
			</author>
			<updated>2018-08-19T09:28:55Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=1758#p1758</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Can I use Switch to develop some logic and not control a pin?]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=1757#p1757" />
			<content type="html"><![CDATA[<p>Thanks a lot. That&#039;s what I thought.</p>]]></content>
			<author>
				<name><![CDATA[pinkman3100]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=697</uri>
			</author>
			<updated>2018-08-19T09:24:32Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=1757#p1757</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Can I use Switch to develop some logic and not control a pin?]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=1756#p1756" />
			<content type="html"><![CDATA[<p>In the configuration of the Switch, just set &quot;Snap to Pin&quot; to &quot;-&quot; {nothing}</p><p>In your sketch you can then write something like...</p><p>if (RemoteXY.switch_1) {<br />&nbsp; your code here<br />}</p><p>There&#039;s no need for any == in the comparison statement, because switch = 1 evaluates as &quot;true&quot;</p><p>or you can use the Switch-Case construct like</p><p>Switch (RemoteXY.switch_1) {<br />&nbsp; case 0:<br />&nbsp; &nbsp; your code here for switch off<br />&nbsp; break;<br />&nbsp; case 1:<br />&nbsp; &nbsp; your code here for switch on<br />&nbsp; break;<br />}</p>]]></content>
			<author>
				<name><![CDATA[Daba]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=630</uri>
			</author>
			<updated>2018-08-19T09:14:51Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=1756#p1756</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Can I use Switch to develop some logic and not control a pin?]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=1755#p1755" />
			<content type="html"><![CDATA[<p>I want to process the data (0 for low and 1 for high) from the Switch and develop a logic accordingly in my loop function. Is this possible? I think this will require a bitstream of 1s or 0s according to switch value. Please Help</p>]]></content>
			<author>
				<name><![CDATA[pinkman3100]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=697</uri>
			</author>
			<updated>2018-08-19T06:01:52Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=1755#p1755</id>
		</entry>
</feed>
