<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[RemoteXY community — Можно ли создать два проекта на одном контроллере?]]></title>
		<link>https://forum.remotexy.com/viewtopic.php?id=1335</link>
		<atom:link href="https://forum.remotexy.com/extern.php?action=feed&amp;tid=1335&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Можно ли создать два проекта на одном контроллере?.]]></description>
		<lastBuildDate>Mon, 21 Jun 2021 05:23:59 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Можно ли создать два проекта на одном контроллере?]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=4070#p4070</link>
			<description><![CDATA[<p>Да, это возможно<br />Ниже код для ESP32 и ESP8266<br /></p><div class="codebox"><pre><code>#if defined (ESP8266)
  #include &lt;ESP8266WiFi.h&gt;
#elif defined (ESP32)
  #include &lt;WiFi.h&gt;  
#endif

#include &lt;RemoteXY.h&gt;


// RemoteXY configurate  

/////////////////////////////////////////////////////////////
// First

#pragma pack(push, 1)
uint8_t const PROGMEM RemoteXY_CONF_PROGMEM_1[] =
  { 255,1,0,1,0,27,0,10,13,2,
  1,0,9,9,46,46,6,7,50,50,
  2,31,88,0,65,4,62,16,31,31,
  14,62,35,35 };
  
// this structure defines all the variables and events of your control interface 
struct {

    // input variables
  uint8_t button_1; // =1 if button pressed, else =0 

    // output variables
  uint8_t led_1_r; // =0..255 LED Red brightness 

    // other variable
  uint8_t connect_flag;  // =1 if wire connected, else =0 

} RemoteXY_1;


/////////////////////////////////////////////////////////////
// Second

uint8_t const PROGMEM RemoteXY_CONF_PROGMEM_2[] =
  { 255,1,0,1,0,19,0,11,27,0,
  1,0,11,7,30,30,94,31,88,0,
  65,4,59,30,21,21 };
  
// this structure defines all the variables and events of your control interface 
struct {

    // input variables
  uint8_t button_1; // =1 if button pressed, else =0 

    // output variables
  uint8_t led_1_r; // =0..255 LED Red brightness 

    // other variable
  uint8_t connect_flag;  // =1 if wire connected, else =0 

} RemoteXY_2;

#pragma pack(pop)



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


CRemoteXY *remotexy_1;
CRemoteXY *remotexy_2;

void setup() 
{
  
  CRemoteXYComm_WiFi * wifi =  new CRemoteXYComm_WiFi (
    &quot;myHomeFiFi&quot;,                            // REMOTEXY_WIFI_SSID
    &quot;myPass&quot;                       // REMOTEXY_WIFI_PASSWORD
  );
  
  remotexy_1 = new CRemoteXY (RemoteXY_CONF_PROGMEM_1, &amp;RemoteXY_1, &quot;&quot;); 
  remotexy_1-&gt;addConnection (new CRemoteXYConnectionCloud ( wifi, 
    &quot;cloud.remotexy.com&quot;,                     // REMOTEXY_CLOUD_SERVER 
    6376,                                     // REMOTEXY_CLOUD_PORT
    &quot;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&quot;        // REMOTEXY_CLOUD_TOKEN
  ));
  
  remotexy_2 = new CRemoteXY (RemoteXY_CONF_PROGMEM_2, &amp;RemoteXY_2, &quot;&quot;); 
  remotexy_2-&gt;addConnection (new CRemoteXYConnectionCloud ( wifi, 
    &quot;cloud.remotexy.com&quot;,                     // REMOTEXY_CLOUD_SERVER 
    6376,                                     // REMOTEXY_CLOUD_PORT
    &quot;YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY&quot;        // REMOTEXY_CLOUD_TOKEN
  ));  
  
  // TODO you setup code
  
}

void loop() 
{ 
  remotexy_1-&gt;handler ();
  remotexy_2-&gt;handler ();
  
  if (RemoteXY_1.button_1)  RemoteXY_1.led_1_r = 255;
  else RemoteXY_1.led_1_r = 0;

  if (RemoteXY_2.button_1)  RemoteXY_2.led_1_r = 255;
  else RemoteXY_2.led_1_r = 0;

  // TODO you loop code
  // use the RemoteXY structure for data transfer
  // do not call delay() 


}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (remotexy)]]></author>
			<pubDate>Mon, 21 Jun 2021 05:23:59 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=4070#p4070</guid>
		</item>
		<item>
			<title><![CDATA[Можно ли создать два проекта на одном контроллере?]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=4051#p4051</link>
			<description><![CDATA[<p>Можно ли создать два проекта на одном контроллере?Хочу сделать два разных проекта через облако с двумя токенами, но ардуинка должна быть одна.Как это сделать.</p>]]></description>
			<author><![CDATA[null@example.com (adel)]]></author>
			<pubDate>Sat, 12 Jun 2021 16:53:50 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=4051#p4051</guid>
		</item>
	</channel>
</rss>
