<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[RemoteXY community — Display water level % in text area]]></title>
	<link rel="self" href="https://forum.remotexy.com/extern.php?action=feed&amp;tid=1784&amp;type=atom" />
	<updated>2024-03-29T03:25:05Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.remotexy.com/viewtopic.php?id=1784</id>
		<entry>
			<title type="html"><![CDATA[Display water level % in text area]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=5470#p5470" />
			<content type="html"><![CDATA[<p>Hi all,</p><p>I am very new to this and have been trying to get my first project running.</p><p>I am trying to get a reading from my water gauge to show in the text box.</p><p>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</p><p>I would also if possible like to have the reading followed by %</p><p>I am sure I am missing something basic but any help would be amazing, sorry for the dumb question!!</p><p>The code I am using is below:</p><p>/*<br />&nbsp; &nbsp;-- Water Sensors --<br />&nbsp; &nbsp;<br />&nbsp; &nbsp;This source code of graphical user interface <br />&nbsp; &nbsp;has been generated automatically by RemoteXY editor.<br />&nbsp; &nbsp;To compile this code using RemoteXY library 3.1.10 or later version <br />&nbsp; &nbsp;download by link <a target="_blank" href="http://remotexy.com/en/library/">http://remotexy.com/en/library/</a><br />&nbsp; &nbsp;To connect using RemoteXY mobile app by link <a target="_blank" href="http://remotexy.com/en/download/">http://remotexy.com/en/download/</a>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp;- for ANDROID 4.13.1 or later version;<br />&nbsp; &nbsp; &nbsp;- for iOS 1.10.1 or later version;<br />&nbsp; &nbsp; <br />&nbsp; &nbsp;This source code is free software; you can redistribute it and/or<br />&nbsp; &nbsp;modify it under the terms of the GNU Lesser General Public<br />&nbsp; &nbsp;License as published by the Free Software Foundation; either<br />&nbsp; &nbsp;version 2.1 of the License, or (at your option) any later version.&nbsp; &nbsp; <br />*/</p><p>//////////////////////////////////////////////<br />//&nbsp; &nbsp; &nbsp; &nbsp; RemoteXY include library&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //<br />//////////////////////////////////////////////</p><p>// you can enable debug logging to Serial at 115200<br />//#define REMOTEXY__DEBUGLOG&nbsp; &nbsp; </p><p>// RemoteXY select connection mode and include library <br />#define REMOTEXY_MODE__SOFTSERIAL<br />#include &lt;SoftwareSerial.h&gt;</p><br /><p>// RemoteXY connection settings <br />#define REMOTEXY_SERIAL_RX 2<br />#define REMOTEXY_SERIAL_TX 3<br />#define REMOTEXY_SERIAL_SPEED 9600</p><br /><p>#include &lt;RemoteXY.h&gt;</p><p>// RemoteXY configurate&nbsp; <br />#pragma pack(push, 1)<br />uint8_t RemoteXY_CONF[] =&nbsp; &nbsp;// 106 bytes<br />&nbsp; { 255,1,0,12,0,99,0,17,0,0,0,31,1,106,200,1,1,6,0,1,<br />&nbsp; 65,29,24,24,1,189,31,82,101,115,101,116,32,70,114,101,115,104,32,65,<br />&nbsp; 108,97,114,109,0,129,18,5,69,12,8,87,97,116,101,114,32,76,101,118,<br />&nbsp; 101,108,115,0,129,20,76,64,12,6,70,114,101,115,104,32,87,97,116,101,<br />&nbsp; 114,0,130,3,91,102,6,0,8,66,16,28,32,14,128,204,26,67,16,46,<br />&nbsp; 32,10,5,31,205,11 };<br />&nbsp; <br />// this structure defines all the variables and events of your control interface <br />struct {</p><p>&nbsp; &nbsp; // input variables<br />&nbsp; uint8_t button_01; // =1 if button pressed, else =0</p><p>&nbsp; &nbsp; // output variables<br />&nbsp; int8_t level_01; // =0..100 level position<br />&nbsp; char text_01[11]; // string UTF8 end zero</p><p>&nbsp; &nbsp; // other variable<br />&nbsp; uint8_t connect_flag;&nbsp; // =1 if wire connected, else =0</p><p>} RemoteXY;<br />#pragma pack(pop)</p><p>/////////////////////////////////////////////<br />//&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;END RemoteXY include&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //<br />/////////////////////////////////////////////</p><br /><br /><p>void setup() <br />{<br />&nbsp; RemoteXY_Init (); <br />&nbsp; <br />&nbsp; <br />&nbsp; // TODO you setup code<br />&nbsp; <br />}</p><p>void loop() <br />{ <br />&nbsp; RemoteXY_Handler ();<br />&nbsp; <br />&nbsp; <br />&nbsp; // TODO you loop code<br />&nbsp; // use the RemoteXY structure for data transfer<br />&nbsp; // do not call delay(), use instead RemoteXY_delay() </p><br /><p>}</p><p>Cheers Dave</p>]]></content>
			<author>
				<name><![CDATA[seekingdave]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=2735</uri>
			</author>
			<updated>2024-03-29T03:25:05Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=5470#p5470</id>
		</entry>
</feed>
