Topic: How to create a multiple instances of RemoteXY using ESP32
Hi!
I need help please.
I made a project with ESP32 the problem is
I can't manage to make several instances of RemoteXY
knowing that I downloaded the same program in both ESP32s.
here is the program:
#define REMOTEXY_MODE__ESP32CORE_WIFI_CLOUD
#include <WiFi.h>
#include <RemoteXY.h>
// RemoteXY connection settings
#define REMOTEXY_WIFI_SSID "************"
#define REMOTEXY_WIFI_PASSWORD "************"
#define REMOTEXY_CLOUD_SERVER "cloud.remotexy.com"
#define REMOTEXY_CLOUD_PORT 6376
#define REMOTEXY_CLOUD_TOKEN "********************************"
// RemoteXY configurate
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
{ 255,4,0,0,0,81,0,10,13,4,
131,1,5,18,23,9,1,2,31,83,
116,111,114,101,32,49,0,131,0,5,
34,23,9,2,2,31,83,116,111,114,
101,32,50,0,1,0,44,23,15,15,
1,2,31,88,0,1,0,65,23,15,
15,1,2,31,88,0,1,0,44,23,
15,15,2,2,31,88,0,1,0,65,
23,15,15,2,2,31,88,0 };
// this structure defines all the variables and events of your control interface
struct {
// input variables
uint8_t DW_1; // =1 if button pressed, else =0
uint8_t UP_1; // =1 if button pressed, else =0
uint8_t DW_2; // =1 if button pressed, else =0
uint8_t UP_2; // =1 if button pressed, else =0
// other variable
uint8_t connect_flag; // =1 if wire connected, else =0
} RemoteXY;
#pragma pack(pop)
#define PIN_DW_1 13
#define PIN_UP_1 12
#define PIN_DW_2 14
#define PIN_UP_2 27
void setup()
{
RemoteXY_Init ();
pinMode (PIN_DW_1, OUTPUT);
pinMode (PIN_UP_1, OUTPUT);
pinMode (PIN_DW_2, OUTPUT);
pinMode (PIN_UP_2, OUTPUT);
}
void loop()
{
RemoteXY_Handler ();
digitalWrite(PIN_DW_1, (RemoteXY.DW_1==0)?LOW:HIGH);
digitalWrite(PIN_UP_1, (RemoteXY.UP_1==0)?LOW:HIGH);
digitalWrite(PIN_DW_2, (RemoteXY.DW_2==0)?LOW:HIGH);
digitalWrite(PIN_UP_2, (RemoteXY.UP_2==0)?LOW:HIGH);
}