It is not bug.
Variable is transmitted in one direction.
//////////////////////////////////////////////
// RemoteXY include library //
// use library version 2.2.5 or up //
// use ANDROID app version 3.7.1 or up //
//////////////////////////////////////////////
/* RemoteXY select connection mode and include library */
#define REMOTEXY_MODE__SOFTSERIAL
#include <SoftwareSerial.h>
#include <RemoteXY.h>
/* RemoteXY connection settings */
#define REMOTEXY_SERIAL_RX 2
#define REMOTEXY_SERIAL_TX 3
#define REMOTEXY_SERIAL_SPEED 9600
/* RemoteXY configurate */
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
{ 4,2,237,0,6,0,2,7,54,4
,30,32,10,4,70,32,11,5,2,0
,4,10,31,10,4,12,31,10,2,77
,65,78,85,65,76,0,65,85,84,79
,0,2,0,4,49,31,10,4,39,31
,10,2,79,78,0,79,70,70,0,66
,1,44,3,36,47,41,6,10,77,5
,65,4,48,52,9,9,16,87,9,9
,2,129,0,6,30,18,6,4,75,0
,6,0,0,129,0,82,45,9,6,53
,79,6,4,9,48,37,0,129,0,82
,24,9,6,53,42,8,4,9,53,48
,37,0,129,0,81,3,15,6,52,7
,11,4,9,49,48,48,37,0,129,0
,4,23,31,6,4,64,24,5,8,65
,117,116,111,32,108,101,118,101,108,58
,0,129,0,3,3,34,6,4,5,29
,5,8,80,117,109,112,32,109,111,100
,101,0,129,0,4,43,21,6,4,32
,18,5,8,77,97,110,117,97,108,0
,130,1,3,22,36,19,2,30,35,23
,0,130,1,3,42,36,18,2,58,35
,25,0,129,0,60,54,18,6,28,89
,26,6,3,80,117,109,112,32,111,110
,0 };
/* this structure defines all the variables of your control interface */
struct {
/* input variable */
int16_t edit_level; /* −32767.. +32767 */
uint8_t switch_manual; /* =1 if switch ON and =0 if OFF */
uint8_t switch_pump; /* =1 if switch ON and =0 if OFF */
/* output variable */
int8_t level; /* =0..100 level position */
uint8_t led_on_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 //
/////////////////////////////////////////////
float level = 50.0;
boolean pump = false;
void setup()
{
RemoteXY_Init ();
RemoteXY.edit_level = 50;
}
long pt=0;
void loop()
{
RemoteXY_Handler ();
// TIME COUNTER
long t = millis ();
long dt = t - pt;
pt = t;
// PUMP EMULATION
level = level + 0.001*dt;
if (pump) level=level-0.003*dt;
if (level<0) level = 0;
if (level>100) level = 100;
// MAIN CODE
if (RemoteXY.switch_manual == 1) {
if (RemoteXY.switch_pump == 1) pump = true;
else pump = false;
}
else {
if ((level>RemoteXY.edit_level+5) && (!pump)) pump = true;
if ((level<RemoteXY.edit_level-5) && (pump)) pump = false;
}
RemoteXY.level = level;
if (pump) RemoteXY.led_on_r = 255;
else RemoteXY.led_on_r = 0;
delay (2);
}