//////////////////////////////////////////////
// RemoteXY include library //
//////////////////////////////////////////////
// RemoteXY select connection mode and include library
#define REMOTEXY_MODE__ESP8266_SOFTSERIAL_POINT
#include <SoftwareSerial.h>
#include <RemoteXY.h>
// RemoteXY connection settings
#define REMOTEXY_SERIAL_RX 2
#define REMOTEXY_SERIAL_TX 3
#define REMOTEXY_SERIAL_SPEED 9600
#define REMOTEXY_WIFI_SSID "Sky"
#define REMOTEXY_WIFI_PASSWORD "12345678"
#define REMOTEXY_SERVER_PORT 6377
// RemoteXY configurate
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
{ 255,1,0,1,0,19,0,8,13,0,
65,4,29,12,40,40,1,0,43,26,
12,12,2,31,88,0 };
// this structure defines all the variables of your control interface
struct {
// input variable
uint8_t button_1; // =1 if button pressed, else =0
// output variable
uint8_t led_1_r; // =0..255 LED Red brightness
// other variable
uint8_t connect_flag; // =1 if wire connected, else =0
} RemoteXY;
#pragma pack(pop)
/////////////////////////////////////////////
// END RemoteXY include //
/////////////////////////////////////////////
SoftwareSerial ESP8266(REMOTEXY_SERIAL_RX, REMOTEXY_SERIAL_TX); //init the serial protocol, define the RX and TX pins
void setup()
{
RemoteXY_Init ();
ESP8266.begin(REMOTEXY_SERIAL_SPEED);
}
void loop()
{
RemoteXY_Handler ();
RemoteXY.led_1_r = RemoteXY.button_1 * 255;
delay(200);
}
2B, or not 2B, that is the pencil ...