<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[RemoteXY community — Arduino statement constrain(ledPinVal, 0, 255); doesn't work on Remote]]></title>
		<link>https://forum.remotexy.com/viewtopic.php?id=1373</link>
		<atom:link href="https://forum.remotexy.com/extern.php?action=feed&amp;tid=1373&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Arduino statement constrain(ledPinVal, 0, 255); doesn't work on Remote.]]></description>
		<lastBuildDate>Tue, 31 Aug 2021 22:04:00 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Arduino statement constrain(ledPinVal, 0, 255); doesn't work on Remote]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=4217#p4217</link>
			<description><![CDATA[<p>Thank you for your prompt reply. Yes, it works. Using constrain as suggested by you saved me a lot a coding. I love your RemoteXY. I have tried the MIT App inventor, Blynk and RoboRemo, but <strong>RemoteXY takes the GOLD</strong>. Thanks again from Sydney, Australia.</p>]]></description>
			<author><![CDATA[null@example.com (Mahen@Oz)]]></author>
			<pubDate>Tue, 31 Aug 2021 22:04:00 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=4217#p4217</guid>
		</item>
		<item>
			<title><![CDATA[Re: Arduino statement constrain(ledPinVal, 0, 255); doesn't work on Remote]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=4216#p4216</link>
			<description><![CDATA[<p>Hello</p><p>constrain doesn&#039;t modify the variable that you pass in it, instead it returns a new value, so must be used like this:<br /></p><div class="codebox"><pre><code>ledPinVal = constrain( ledPinVal, 0, 255 );</code></pre></div><p>Or, using if statement:<br /></p><div class="codebox"><pre><code>if ( ledPinVal &lt; 0 )
{
  ledPinVal = 0;
}
else if ( ledPinVal &gt; 255 )
{
  ledPinVal = 255;
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Guillaume)]]></author>
			<pubDate>Tue, 31 Aug 2021 15:52:02 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=4216#p4216</guid>
		</item>
		<item>
			<title><![CDATA[Arduino statement constrain(ledPinVal, 0, 255); doesn't work on Remote]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=4215#p4215</link>
			<description><![CDATA[<p>With the up/down button to increase/degrease a value within the limit 0-255, the Arduino statement </p><p>constrain(ledPinVal, 0, 255); doesn&#039;t limit the value to 255. It keeps going up &gt;255 and &lt;0 as well.</p><p>But this statement </p><p>if (ledPinVal &lt;= 0 || ledPinVal &gt;= 255) {<br />&nbsp; ledPinVal=255;//works.</p><p>Same for </p><p>if (ledPinVal &lt;= 0 || ledPinVal &gt;= 255) {<br />&nbsp; ledPinVal=0;//works</p>]]></description>
			<author><![CDATA[null@example.com (Mahen@Oz)]]></author>
			<pubDate>Tue, 31 Aug 2021 08:55:13 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=4215#p4215</guid>
		</item>
	</channel>
</rss>
