<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[RemoteXY community — Пример кода для RGB круга]]></title>
	<link rel="self" href="https://forum.remotexy.com/extern.php?action=feed&amp;tid=138&amp;type=atom" />
	<updated>2017-03-28T20:10:17Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.remotexy.com/viewtopic.php?id=138</id>
		<entry>
			<title type="html"><![CDATA[Re: Пример кода для RGB круга]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=509#p509" />
			<content type="html"><![CDATA[<p>Без экспоненты будет еще проще<br /></p><div class="codebox"><pre><code>analogWrite (pinRed, RemoteXY.rgb_1_r);
analogWrite (pinGreen, RemoteXY.rgb_1_g);
analogWrite (pinBlue, RemoteXY.rgb_1_b);</code></pre></div>]]></content>
			<author>
				<name><![CDATA[remotexy]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=2</uri>
			</author>
			<updated>2017-03-28T20:10:17Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=509#p509</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Пример кода для RGB круга]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=508#p508" />
			<content type="html"><![CDATA[<p>Ниже пример кода. <br />Регулировка напряжения на светодиодах осуществляется по экспоненте.<br />Экспонента дает лучшее визуальное ощущение увеличения и уменьшения яркости.<br />Код из какого то старого проекта, для Arduino+ESP как точка доступа. Для примера.</p><div class="codebox"><pre><code>////////////////////////////////////////////// 
//        RemoteXY include library          // 
//     use  library  version 2.2.5 or up    // 
//   use ANDROID app version 3.7.1 or up    // 
////////////////////////////////////////////// 

/* RemoteXY select connection mode and include library */ 
#define REMOTEXY_MODE__ESP8266POINT_HARDSERIAL

#include &lt;RemoteXY.h&gt; 

/* RemoteXY connection settings */ 
#define REMOTEXY_SERIAL Serial 
#define REMOTEXY_SERIAL_SPEED 115200 
#define REMOTEXY_WIFI_SSID &quot;RemoteXY&quot; 
#define REMOTEXY_WIFI_PASSWORD &quot;12345678&quot; 
#define REMOTEXY_SERVER_PORT 6377 


/* RemoteXY configurate  */ 
#pragma pack(push, 1)
unsigned char RemoteXY_CONF[] = 
  { 3,0,14,0,6,5,2,6,0,24
  ,6,52,52,6,24,51,51,2 }; 
   
/* this structure defines all the variables of your control interface */  
struct { 

    /* input variable */
  uint8_t rgb_1_r; /* =0..255 Red color value */
  uint8_t rgb_1_g; /* =0..255 Green color value */
  uint8_t rgb_1_b; /* =0..255 Blue color value */

    /* other variable */
  unsigned char connect_flag;  /* =1 if wire connected, else =0 */

} RemoteXY; 
#pragma pack(pop) 

///////////////////////////////////////////// 
//           END RemoteXY include          // 
///////////////////////////////////////////// 

#define pinRed 9 // Выход красной компоненты цвета;
#define pinGreen 10 // Выход зеленой компоненты цвета;
#define pinBlue 11 // Выход синей компоненты цвета;

void setup()  
{ 
  RemoteXY_Init ();  
   
} 

void loop()  
{  
  RemoteXY_Handler (); 

   
  analogWrite (pinRed, pow (RemoteXY.rgb_1_r / 255.0, 2.718) * 255.0);
  analogWrite (pinGreen, pow (RemoteXY.rgb_1_g / 255.0, 2.718) * 255.0);
  analogWrite (pinBlue, pow (RemoteXY.rgb_1_b / 255.0, 2.718) * 255.0);

}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[remotexy]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=2</uri>
			</author>
			<updated>2017-03-28T20:07:57Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=508#p508</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Пример кода для RGB круга]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=507#p507" />
			<content type="html"><![CDATA[<p>Если можно, приведите пример кода для RGB круга. В документации этот пункт отсутствует.</p>]]></content>
			<author>
				<name><![CDATA[bondarenkoigv]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=279</uri>
			</author>
			<updated>2017-03-28T19:54:33Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=507#p507</id>
		</entry>
</feed>
