то есть сгенерированный код для IDE? вот он
[spoiler]#define REMOTEXY_MODE__ESP8266WIFI_LIB_CLOUD
#include <ESP8266WiFi.h>
#include <RemoteXY.h>
#include <Adafruit_NeoPixel.h>
extern "C" {
#include "user_interface.h";
}
#define REMOTEXY_WIFI_SSID "VitaliNadin"
#define REMOTEXY_WIFI_PASSWORD "27072017"
#define REMOTEXY_CLOUD_SERVER "cloud.remotexy.com"
#define REMOTEXY_CLOUD_PORT 6376
#define REMOTEXY_CLOUD_TOKEN "мой токен"
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] = {4, 1, 34, 0, 8, 24, 1, 2, 0, 5, 83, 28, 13, 2, 26, 31, 16, 79, 78, 0, 79, 70, 70, 0, 65, 4, 45, 83, 12, 12, 6, 0, 3, 5, 57, 57, 2, 26};
struct {
unsigned char switch_1;
unsigned char rgb_1_r;
unsigned char rgb_1_g;
unsigned char rgb_1_b;
unsigned char led_1_r;
unsigned char connect_flag;
} RemoteXY;
#pragma pack(pop)
// NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs)
// NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)
// NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products)
// NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)
// NEO_RGBW Pixels are wired for RGBW bitstream (NeoPixel RGBW products)
Adafruit_NeoPixel strip= Adafruit_NeoPixel(64, D4, NEO_GRB + NEO_KHZ800);
bool En_26897752_2;
int Num_Led_26897752_2;
byte Brightness_26897752_2;
byte Led_R_26897752_2;
byte Led_G_26897752_2;
byte Led_B_26897752_2;
byte Led_W_26897752_2;
extern "C" {
#include "user_interface.h"
}
os_timer_t watchDogTimer;
int _PWDC = 0;
bool ESP8266ControllerWifiClient_HRD = 0;
bool ESP8266ControllerWifiClient_status = 1;
char ESP8266ControllerWifiAP_SSID[40] = "raz";
char ESP8266ControllerWifiAP_password[40] = "";
bool ESP8266ControllerWifiAP_IsNeedReconect = 0;
bool ESP8266ControllerWifiAP_workStatus = 1;
IPAddress ESP8266ControllerWifiAP_ip(0, 0, 0, 0);
IPAddress ESP8266ControllerWifiAP_dns (0, 0, 0, 1);
IPAddress ESP8266ControllerWifiAP_gateway (0, 0, 0, 1);
IPAddress ESP8266ControllerWifiAP_subnet (255, 255, 255, 0);
uint8_t ESP8266ControllerWifiAP_mac[6] = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0};
bool ESP8266ControllerWifiClient_isDHCP = 1;
bool ESP8266ControllerWifiClient_IsNeedReconect = 0;
bool ESP8266ControllerWifiClient_workStatus = 1;
char ESP8266ControllerWifiClient_SSID[40] = "VitaliNadin";
char ESP8266ControllerWifiClient_password[40] = "27072017";
IPAddress ESP8266ControllerWifiClient_ip(0, 0, 0, 0);
IPAddress ESP8266ControllerWifiClient_dns (0, 0, 0, 1);
IPAddress ESP8266ControllerWifiClient_gateway (0, 0, 0, 1);
IPAddress ESP8266ControllerWifiClient_subnet (255, 255, 255, 0);
uint8_t ESP8266ControllerWifiClient_mac[6] = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0};
bool _gtv1;
int _gtv2;
int _gtv3;
int _gtv4;
int _swi1;
void setup()
{
RemoteXY_Init ();
WiFi.mode(WIFI_AP_STA);
_esp8266WifiModuleClientReconnect();
_esp8266WifiModuleApReconnect();
satrtWachDogTimer();
pinMode(2, OUTPUT);
strip.begin(); // Инициализация NeoPixel library.
strip.show(); // Устанавливаем все светодиоды в состояние "Выключено"
}
void loop()
{RemoteXY_Handler ();
_PWDC = 0;
if(ESP8266ControllerWifiAP_IsNeedReconect) {_esp8266WifiModuleApReconnect(); ESP8266ControllerWifiAP_IsNeedReconect = 0; }
if(ESP8266ControllerWifiClient_IsNeedReconect) {_esp8266WifiModuleClientReconnect(); ESP8266ControllerWifiClient_IsNeedReconect = 0; }
ESP8266ControllerWifiClient_status = WiFi.status() == WL_CONNECTED;
if (ESP8266ControllerWifiClient_status) { if ( ! ESP8266ControllerWifiClient_HRD) { ESP8266ControllerWifiClient_ip = WiFi.localIP();
ESP8266ControllerWifiClient_subnet = WiFi.subnetMask();
ESP8266ControllerWifiClient_gateway = WiFi.gatewayIP();
ESP8266ControllerWifiClient_dns = WiFi.dnsIP();
WiFi.macAddress(ESP8266ControllerWifiClient_mac);
ESP8266ControllerWifiClient_HRD = 1;
}} else {ESP8266ControllerWifiClient_HRD = 0;}
//Плата:1
if(_gtv1)
{_swi1=255;}
else
{_swi1=0;}
RemoteXY.led_1_r = _swi1;
_gtv4 = (RemoteXY.rgb_1_b);
_gtv3 = (RemoteXY.rgb_1_g);
_gtv2 = (RemoteXY.rgb_1_r);
En_26897752_2 = (RemoteXY.switch_1);
Num_Led_26897752_2 = 0;
Brightness_26897752_2 = 100;
Led_R_26897752_2 = (byte(_gtv2));
Led_G_26897752_2 = (byte(_gtv3));
Led_B_26897752_2 = (byte(_gtv4));
Led_W_26897752_2 = 0;
if ( En_26897752_2 == 1)
{
strip.setBrightness(Brightness_26897752_2);
strip.setPixelColor(Num_Led_26897752_2, strip.Color(Led_R_26897752_2, Led_G_26897752_2, Led_B_26897752_2, Led_W_26897752_2 ) );
strip.show();
}
else
{
strip.setPixelColor(Num_Led_26897752_2, strip.Color(0, 0, 0, 0 ) );
strip.show();
};
_gtv1 = (RemoteXY.switch_1);
digitalWrite(2, !((RemoteXY.switch_1)));
}
bool _isTimer(unsigned long startTime, unsigned long period )
{
unsigned long currentTime;
currentTime = millis();
if (currentTime>= startTime) {return (currentTime>=(startTime + period));} else {return (currentTime >=(4294967295-startTime+period));}
}
void wachDogTimerTick(void *pArg) {
if (_PWDC >= 100){ ESP.reset(); }else{_PWDC = _PWDC+1;}
}
void satrtWachDogTimer(void ) {
os_timer_setfn(&watchDogTimer, wachDogTimerTick, NULL);
os_timer_arm(&watchDogTimer, 100, true);
}
int hexStrToInt(String instring)
{
byte len = instring.length();
if (len == 0) return 0;
int result = 0;
for (byte i = 0; i < 8; i++) // только первые 8 цыфар влезуть в uint32
{
char ch = instring
;
if (ch == 0) break;
result <<= 4;
if (isdigit(ch))
result = result | (ch - '0');
else result = result | (ch - 'A' + 10);
}
return result;
}
void _esp8266WifiModuleApReconnect()
{
if ( _checkMacAddres(ESP8266ControllerWifiAP_mac)) {
wifi_set_macaddr(1, const_cast<uint8*>(ESP8266ControllerWifiAP_mac));
}
WiFi.softAPConfig(ESP8266ControllerWifiAP_ip, ESP8266ControllerWifiAP_gateway, ESP8266ControllerWifiAP_subnet);
WiFi.softAP(ESP8266ControllerWifiAP_SSID, ESP8266ControllerWifiAP_password);
if ( ! (_checkMacAddres(ESP8266ControllerWifiAP_mac))) {
WiFi.softAPmacAddress(ESP8266ControllerWifiAP_mac);
}
}
void _esp8266WifiModuleClientReconnect()
{
if( _checkMacAddres(ESP8266ControllerWifiClient_mac)) { wifi_set_macaddr(0, const_cast<uint8*>(ESP8266ControllerWifiClient_mac));}
if( ESP8266ControllerWifiClient_isDHCP) { WiFi.config(0U, 0U, 0U, 0U, 0U); } else {
WiFi.config(ESP8266ControllerWifiClient_ip, ESP8266ControllerWifiClient_gateway, ESP8266ControllerWifiClient_subnet, ESP8266ControllerWifiClient_dns , ESP8266ControllerWifiClient_dns );
}
WiFi.begin(ESP8266ControllerWifiClient_SSID, ESP8266ControllerWifiClient_password);
}
bool _checkMacAddres(byte array[])
{
bool result = 0;
for (byte i = 0; i < 6; i++)
{
if (array == 255) {
return 0;
}
if (array > 0 ) {
result = 1;
}
}
return result;
}[/spoiler]