I have downloaded a sketch from a Russian forum that uses remotexy with the esp8266 but keep receiving an error when verifying. I tells me that settemp is not declared in this scope but i cannot figure out why, any help would be appreciated. The code is as follows:-
//////////////////////////////////////////////
// RemoteXY include library //
// use library version 2.2.2 or up //
// use ANDROID app version 3.4.1 or up //
//////////////////////////////////////////////
/* определение режима соединения и подключение библиотеки RemoteXY */
#define REMOTEXY_MODE__ESP8266POINT_HARDSERIAL
#include "RemoteXY.h";
/* настройки соединения */
#define REMOTEXY_SERIAL Serial
#define REMOTEXY_SERIAL_SPEED 115200
#define REMOTEXY_WIFI_SSID "RemoteXY"
#define REMOTEXY_WIFI_PASSWORD "12345678"
#define REMOTEXY_SERVER_PORT 6377
/* конфигурация интерфейса */
unsigned char RemoteXY_CONF[] =
{ 3,33,57,1,4,5,4,128,5,11
,57,7,2,2,0,68,11,28,8,2
,79,78,0,79,70,70,0,2,0,68
,29,28,8,2,79,78,0,79,70,70
,0,67,4,22,20,20,6,4,11,67
,4,22,38,20,6,4,11,67,4,22
,52,20,6,4,11,130,1,3,3,61
,26,5,129,0,5,5,57,5,0,208
,151,208,176,208,180,208,176,208,189,208
,189,208,176,209,143,32,209,130,208,181
,208,188,208,191,208,181,209,128,208,176
,209,130,209,131,209,128,208,176,0,129
,0,43,20,7,6,0,194,176,67,0
,129,0,5,31,55,5,0,208,162,208
,181,208,186,209,131,209,137,209,143,209
,143,32,209,130,208,181,208,188,208,191
,208,181,209,128,208,176,209,130,209,131
,209,128,208,176,0,130,1,3,30,61
,30,5,129,0,44,38,7,6,0,194
,176,67,0,129,0,5,46,50,5,0
,208,162,208,181,208,186,209,131,209,137
,209,143,209,143,32,208,178,208,187,208
,176,208,182,208,189,208,190,209,129,209
,130,209,140,0,129,0,44,52,5,6
,0,37,0,129,0,68,4,26,6,0
,208,160,208,181,208,187,208,181,32,226
,132,150,51,0,129,0,68,23,26,6
,0,208,160,208,181,208,187,208,181,32
,226,132,150,52,0,130,1,66,3,32
,36,5,129,0,68,47,29,5,12,208
,163,208,188,208,189,209,139,208,185,32
,208,180,208,190,208,188,0 };
/* structure determines all the variables of your control interface */
struct {
/* input variable */
signed char slider_setTemp; /* =0..100 the slider */
unsigned char switch_relay3; /* =1 if the switch is turned on and off if 0 = */
unsigned char switch_relay4; /* =1if the switch is turned on and off if 0 = */
/* output variable */
char text_setTemp[11]; /* =string terminated string UNICODE */
char text_valTemp[11]; /* =string terminated string UNICODE */
char text_valHum[11]; /* =string terminated string UNICODE */
/* other variable */
unsigned char connect_flag; /* =1 if wire connected, else =0 */
} RemoteXY;
/////////////////////////////////////////////
// END RemoteXY include //
/////////////////////////////////////////////
#include "DHT.h"
#define PIN_RELAY_COLD 7
#define PIN_RELAY_HOT 6
#define PIN_RELAY_3 5
#define PIN_RELAY_4 4
#define PIN_DHT 8
DHT dht(PIN_DHT, DHT11);
void setup()
{
RemoteXY_Init ();
// TODO you setup code
pinMode (PIN_RELAY_COLD, OUTPUT);
pinMode (PIN_RELAY_HOT, OUTPUT);
pinMode (PIN_RELAY_3, OUTPUT);
pinMode (PIN_RELAY_4, OUTPUT);
}
void loop()
{
RemoteXY_Handler ();
// TODO you loop code
// Use RemoteXY data structure
///////////////////////////////
// task logic smart home //
///////////////////////////////
// We get the value of the set temperature of 10 to 40 grad.ts.
int setTemp = RemoteXY.slider_setTemp/100.0*30.0+10.0;
// We pass the set temperature back to your smartphone
itoa (setTemp, RemoteXY.text_setTemp, 10);
// interrogate DHT11 sensor
int valTemp = dht.readTemperature();
int valHum = dht.readHumidity();
//We send the temperature and humidity in the interface
itoa (valTemp, RemoteXY.text_valTemp, 10);
itoa (valHum, RemoteXY.text_valHum, 10);
// at a given temperature control logic
digitalWrite(PIN_RELAY_COLD, (valTemp>setTemp)?HIGH:LOW);
digitalWrite(PIN_RELAY_HOT, (valTemp<settemp )?HIGH:LOW);
// We set the relay 3 and 4 in accordance with the interface switches
digitalWrite(PIN_RELAY_3, (RemoteXY.switch_relay3==0)?LOW:HIGH);
digitalWrite(PIN_RELAY_4, (RemoteXY.switch_relay4==0)?LOW:HIGH);
}