<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[RemoteXY community — How to change LED color]]></title>
	<link rel="self" href="https://forum.remotexy.com/extern.php?action=feed&amp;tid=1302&amp;type=atom" />
	<updated>2021-04-15T21:20:32Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.remotexy.com/viewtopic.php?id=1302</id>
		<entry>
			<title type="html"><![CDATA[Re: How to change LED color]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=3853#p3853" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>barbichonbd wrote:</cite><blockquote><p>Thanks for replying, but I&#039;m very confusing abaout how this works!<br />Could you give me a very simple example of how to display a red led, wait 1 second, change the led color to blue?</p></blockquote></div><p>When you configure an LED on the interface, you can choose 1 to 3 colours, Red, Green, and Blue.</p><p>For each colour you &quot;enable&quot; you get a variable declared in the interface code. Each variable can be sent a value corresponding to the brightness of that colour, 0 to 255.</p><p>More than one colour, you are able to &quot;mix&quot; them.&nbsp; In this example for RGB_led I have configured all 3 colours, and the interface code generates me 3 output variables ...</p><div class="codebox"><pre><code>    // output variables
  uint8_t RGB_led_r; // =0..255 LED Red brightness 
  uint8_t RGB_led_g; // =0..255 LED Green brightness 
  uint8_t RGB_led_b; // =0..255 LED Blue brightness </code></pre></div><p>If you only want Red and Blue, don&#039;t check the Green box in the LED configuration.</p><p>A Red LED would be LED_r = 255, LED_b = 0<br />A Blue LED would be LED_r = 0, LED_b = 255</p><p>If you set them both to 255, you would get Magenta, i.e. Red and Blue mixed.&nbsp; Of course you can use any values in between to get different &quot;hues&quot; and brightnesses.</p><p>Your sketch can write separate values to those variables to produce a total of 256 x 256 x 256 colours, just over 16 million combinations !!</p><p>Don&#039;t use the &quot;delay()&quot; function for waiting, the interface to your phone will almost certainly disconnect. Instead keep a track of elapsed milliseconds. There are loads of tutorials on the internet for doing timing without using delay()</p>]]></content>
			<author>
				<name><![CDATA[Daba]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=630</uri>
			</author>
			<updated>2021-04-15T21:20:32Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=3853#p3853</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: How to change LED color]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=3851#p3851" />
			<content type="html"><![CDATA[<p>Thanks for replying, but I&#039;m very confusing abaout how this works!<br />Could you give me a very simple example of how to display a red led, wait 1 second, change the led color to blue?</p>]]></content>
			<author>
				<name><![CDATA[barbichonbd]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=1813</uri>
			</author>
			<updated>2021-04-15T12:13:43Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=3851#p3851</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: How to change LED color]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=3844#p3844" />
			<content type="html"><![CDATA[<p>You can use LED element. <a target="_blank" href="https://remotexy.com/en/help/indications/led/">https://remotexy.com/en/help/indications/led/</a></p>]]></content>
			<author>
				<name><![CDATA[remotexy]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=2</uri>
			</author>
			<updated>2021-04-14T04:45:10Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=3844#p3844</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[How to change LED color]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=3840#p3840" />
			<content type="html"><![CDATA[<p>Hello,<br />I just want simply, change an object color via the sketch.<br />Example a LED would be green if a relay is on , and red if a relay is off. So color changed by the sketch decision.<br />Would it be possible?<br />Thanks</p>]]></content>
			<author>
				<name><![CDATA[barbichonbd]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=1813</uri>
			</author>
			<updated>2021-04-13T14:34:34Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=3840#p3840</id>
		</entry>
</feed>
