1

Topic: Display water level % in text area

Hi all,

I am very new to this and have been trying to get my first project running.

I am trying to get a reading from my water gauge to show in the text box.

I can get a part reading, for example if the reading is 71 it will show 7 and if the reading is 40 it will show 4

I would also if possible like to have the reading followed by %

I am sure I am missing something basic but any help would be amazing, sorry for the dumb question!!

The code I am using is below:

/*
   -- Water Sensors --
   
   This source code of graphical user interface
   has been generated automatically by RemoteXY editor.
   To compile this code using RemoteXY library 3.1.10 or later version
   download by link http://remotexy.com/en/library/
   To connect using RemoteXY mobile app by link http://remotexy.com/en/download/                   
     - for ANDROID 4.13.1 or later version;
     - for iOS 1.10.1 or later version;
   
   This source code is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2.1 of the License, or (at your option) any later version.   
*/

//////////////////////////////////////////////
//        RemoteXY include library          //
//////////////////////////////////////////////

// you can enable debug logging to Serial at 115200
//#define REMOTEXY__DEBUGLOG   

// RemoteXY select connection mode and include library
#define REMOTEXY_MODE__SOFTSERIAL
#include <SoftwareSerial.h>


// RemoteXY connection settings
#define REMOTEXY_SERIAL_RX 2
#define REMOTEXY_SERIAL_TX 3
#define REMOTEXY_SERIAL_SPEED 9600


#include <RemoteXY.h>

// RemoteXY configurate 
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =   // 106 bytes
  { 255,1,0,12,0,99,0,17,0,0,0,31,1,106,200,1,1,6,0,1,
  65,29,24,24,1,189,31,82,101,115,101,116,32,70,114,101,115,104,32,65,
  108,97,114,109,0,129,18,5,69,12,8,87,97,116,101,114,32,76,101,118,
  101,108,115,0,129,20,76,64,12,6,70,114,101,115,104,32,87,97,116,101,
  114,0,130,3,91,102,6,0,8,66,16,28,32,14,128,204,26,67,16,46,
  32,10,5,31,205,11 };
 
// this structure defines all the variables and events of your control interface
struct {

    // input variables
  uint8_t button_01; // =1 if button pressed, else =0

    // output variables
  int8_t level_01; // =0..100 level position
  char text_01[11]; // string UTF8 end zero

    // other variable
  uint8_t connect_flag;  // =1 if wire connected, else =0

} RemoteXY;
#pragma pack(pop)

/////////////////////////////////////////////
//           END RemoteXY include          //
/////////////////////////////////////////////



void setup()
{
  RemoteXY_Init ();
 
 
  // TODO you setup code
 
}

void loop()
{
  RemoteXY_Handler ();
 
 
  // TODO you loop code
  // use the RemoteXY structure for data transfer
  // do not call delay(), use instead RemoteXY_delay()


}

Cheers Dave