<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[RemoteXY community — Индикация]]></title>
	<link rel="self" href="https://forum.remotexy.com/extern.php?action=feed&amp;tid=1576&amp;type=atom" />
	<updated>2023-01-14T03:46:47Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.remotexy.com/viewtopic.php?id=1576</id>
		<entry>
			<title type="html"><![CDATA[Re: Индикация]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=4963#p4963" />
			<content type="html"><![CDATA[<p>Glad you figured it out.</p>]]></content>
			<author>
				<name><![CDATA[Gunner]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=1840</uri>
			</author>
			<updated>2023-01-14T03:46:47Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=4963#p4963</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Индикация]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=4957#p4957" />
			<content type="html"><![CDATA[<p>проблему решил сам</p>]]></content>
			<author>
				<name><![CDATA[xxbaykov]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=2283</uri>
			</author>
			<updated>2023-01-12T13:08:05Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=4957#p4957</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Индикация]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=4951#p4951" />
			<content type="html"><![CDATA[<p>в очередной раз прошу помощи в своем вопросе</p>]]></content>
			<author>
				<name><![CDATA[xxbaykov]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=2283</uri>
			</author>
			<updated>2023-01-07T13:10:02Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=4951#p4951</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Индикация]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=4934#p4934" />
			<content type="html"><![CDATA[<p>Удалось отправить код. Подскажите, где необходимо исправить? И если возможно, выделите цветом. Спасибо!<br /></p><div class="codebox"><pre><code>#define  REMOTEXY_MODE__ESP8266WIFI_LIB_CLOUD
#include &lt;ESP8266WiFi.h&gt;
#include &lt;RemoteXY.h&gt;
extern &quot;C&quot; 
{
    #include &quot;user_interface.h&quot;
}
#define REMOTEXY_WIFI_SSID &quot;*****&quot;
#define REMOTEXY_WIFI_PASSWORD &quot;******&quot;
#define REMOTEXY_CLOUD_SERVER &quot;cloud.remotexy.com&quot;
#define REMOTEXY_CLOUD_PORT 6376
#define REMOTEXY_CLOUD_TOKEN &quot;f568b4899837f0c&quot;
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] = {255, 0, 0, 11, 0, 12, 0, 16, 31, 1, 67, 5, 14, 42, 33, 17, 2, 26, 11};
struct 
{
    char text_1[11];
    unsigned char connect_flag;
}
 RemoteXY;
#pragma pack(pop)
int ESP8266_AnalogInputValue;
unsigned long ESP8266_AnalogInputValue_StR;
bool ESPControllerWifiClient_HRD = 0;
bool ESPControllerWifiClient_status = 1;
bool ESPControllerWifiClient_isDHCP = 1;
bool ESPControllerWifiClient_IsNeedReconect = 0;
bool ESPControllerWifiClient_workStatus = 1;
char ESPControllerWifiClient_SSID[40] = &quot;*****&quot;;
char ESPControllerWifiClient_password[40] = &quot;*****&quot;;
IPAddress ESPControllerWifiClient_ip(0, 0, 0, 0);
IPAddress  ESPControllerWifiClient_dns (0, 0, 0, 1);
IPAddress  ESPControllerWifiClient_gateway (0, 0, 0, 1);
IPAddress ESPControllerWifiClient_subnet (255, 255, 255, 0);
uint8_t ESPControllerWifiClient_mac[6] = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0};
void setup()
{
    RemoteXY_Init ();
    ESP8266_AnalogInputValue_StR = millis() + 500 ;
    WiFi.mode(WIFI_STA);
    _esp8266WifiModuleClientReconnect();
}
void loop()
{
    RemoteXY_Handler  ();
    if(ESPControllerWifiClient_IsNeedReconect) 
    {
        _esp8266WifiModuleClientReconnect();
        ESPControllerWifiClient_IsNeedReconect = 0;
    }
    ESPControllerWifiClient_status = WiFi.status() == WL_CONNECTED;
    if (ESPControllerWifiClient_status) 
    {
         if (! ESPControllerWifiClient_HRD) 
        {
            ESPControllerWifiClient_ip =  WiFi.localIP();
            ESPControllerWifiClient_subnet =  WiFi.subnetMask();
            ESPControllerWifiClient_gateway =  WiFi.gatewayIP();
            ESPControllerWifiClient_dns =  WiFi.dnsIP();
            WiFi.macAddress(ESPControllerWifiClient_mac);
            ESPControllerWifiClient_HRD = 1;
        }
    }
     else 
    {
        ESPControllerWifiClient_HRD = 0;
    }
    if(_isTimer(ESP8266_AnalogInputValue_StR, 500))
    {
        ESP8266_AnalogInputValue_StR = millis();
        ESP8266_AnalogInputValue = analogRead(A0);
    }
    //Плата:1
    ((String(ESP8266_AnalogInputValue, DEC))).toCharArray((RemoteXY.text_1), 11);
}
bool _isTimer(unsigned long startTime, unsigned long period)
{
    unsigned long currentTime;
    currentTime = millis();
    if (currentTime&gt;= startTime) 
    {
        return (currentTime&gt;=(startTime + period));
    }
     else 
    {
        return (currentTime &gt;=(4294967295-startTime+period));
    }
}
int hexStrToInt(String instring)
{
    byte len = instring.length();
    if  (len == 0) return 0;
    int result = 0;
    for (byte i = 0; i &lt; 8; i++)    // только первые 8 цыфар влезуть в uint32
    {
        char ch = instring[i];
        if (ch == 0) break;
        result &lt;&lt;= 4;
        if (isdigit(ch))
        result = result | (ch - &#039;0&#039;);
        else result = result | (ch - &#039;A&#039; + 10);
    }
    return result;
}
void _esp8266WifiModuleClientReconnect()
{
    if(_checkMacAddres(ESPControllerWifiClient_mac)) 
    {
          wifi_set_macaddr(0, const_cast&lt;uint8*&gt;(ESPControllerWifiClient_mac));
    }
    if(ESPControllerWifiClient_isDHCP) 
    {
         WiFi.config(0U, 0U, 0U, 0U, 0U);
    }
     else 
    {
        WiFi.config(ESPControllerWifiClient_ip, ESPControllerWifiClient_gateway, ESPControllerWifiClient_subnet, ESPControllerWifiClient_dns , ESPControllerWifiClient_dns);
    }
    WiFi.begin(ESPControllerWifiClient_SSID, ESPControllerWifiClient_password);
}
bool _checkMacAddres(byte array[])
{
    bool result = 0;
    for (byte i = 0; i &lt; 6; i++)
    {
        if (array[i] == 255) 
        {
            return 0;
        }
        if (array[i] &gt; 0) 
        {
            result = 1;
        }
    }
    return result;
}
void _parseMacAddressString(String value, byte array[])
{
    int index;
    byte buffer[6] = {255, 255, 255, 255, 255, 255};
    byte raz = 0;
    String tempString;
    while ((value.length() &gt; 0) &amp;&amp; (raz &lt;= 6)) 
    {
        index = value.indexOf(&quot;:&quot;);
        if (index == -1) 
        {
            tempString = value;
            value = &quot;&quot;;
        }
         else 
        {
            tempString = value.substring(0, index);
            value = value.substring(index + 1);
        }
        buffer[raz] = byte(hexStrToInt(tempString));
        raz++;
    }
    if (_checkMacAddres(buffer))
    {
        for (byte i = 0; i &lt; 6; i++)
        {
            array[i] = buffer[i];
        }
    }
}
bool _compareMacAddreses(byte array1[], byte array2[])
{
    for (byte i = 0; i &lt; 6; i++)
    {
        if (array1[i] != array2[i]) 
        {
            return 0;
        }
    }
    return 1;
}
bool _compareMacAddresWithString(byte array[], String value)
{
    byte buffer[6] = {255, 255, 255, 255, 255, 255};
    _parseMacAddressString(value,  buffer);
    return _compareMacAddreses(array, buffer);
}
bool _checkMacAddresString(String value)
{
    byte buffer[6] = {255, 255, 255, 255, 255, 255};
    _parseMacAddressString(value,  buffer);
    return _checkMacAddres(buffer);
}
String _macAddresToString(byte array[])
{
    String result = &quot;&quot;;
    String  temp =&quot;&quot;;
    for (byte i = 0; i &lt; 6; i++)
    {
        temp=String(array[i],HEX);
        if (temp.length()  &lt; 2) 
        {
            temp = String(&quot;0&quot;) + temp;
        }
        result = result + temp;
        if (i &lt; 5) 
        {
               result = result + String(&quot;:&quot;);
        }
    }
    result.toUpperCase();
    return result;
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[xxbaykov]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=2283</uri>
			</author>
			<updated>2022-12-26T13:50:57Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=4934#p4934</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Индикация]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=4932#p4932" />
			<content type="html"><![CDATA[<p>По той же ссылке самый последний пример. <a target="_blank" href="https://remotexy.com/en/help/indications/text/">https://remotexy.com/en/help/indications/text/</a><br /></p><div class="codebox"><pre><code>  // АЦП равен 204.8 на вольт при напряжении питания 5 Вольт
  double val = analogRead(A0) / 204.8; 
  dtostrf(val, 0, 2, RemoteXY.text_1); </code></pre></div><p>Так же можете посмотреть этот пример <a target="_blank" href="https://remotexy.com/ru/examples/temperature/">https://remotexy.com/ru/examples/temperature/</a></p>]]></content>
			<author>
				<name><![CDATA[remotexy]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=2</uri>
			</author>
			<updated>2022-12-26T09:15:17Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=4932#p4932</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Индикация]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=4928#p4928" />
			<content type="html"><![CDATA[<p>Внимание!Перед публикацией вашего сообщения необходимо исправить следующие ошибки:<br />[i— был открыт внутри себя, это недопустимо</p><br /><p>Не получается отправить код, каждый раз появляется такая информация на экране</p>]]></content>
			<author>
				<name><![CDATA[xxbaykov]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=2283</uri>
			</author>
			<updated>2022-12-23T18:25:40Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=4928#p4928</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Индикация]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=4927#p4927" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>xxbaykov wrote:</cite><blockquote><p>Обычно получается вывести только целые числа.</p></blockquote></div><p>If you are already able to do this, then just follow the already simple example given to replace your normal print output with</p><div class="codebox"><pre><code>dtostrf()</code></pre></div><p>Perhaps... Show us what you DO have working so someone can better explain with what you already know.</p><p>Select and enclose your posted code using the editing button &lt;&gt; to make it easier for us to follow along.</p>]]></content>
			<author>
				<name><![CDATA[Gunner]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=1840</uri>
			</author>
			<updated>2022-12-23T01:57:56Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=4927#p4927</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Индикация]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=4926#p4926" />
			<content type="html"><![CDATA[<p>Добрый вечер! я очень далек от программирования. Прошу Вас показать пример простейшей программы программы с выводом на экран телефона текстовой индикации с десятыми долями числа со&nbsp; входа А0 платы Wemos mini. Может с примера пойму куда вставить текст написанный Вами ранее. У меня пока ничего не получается. Спасибо</p>]]></content>
			<author>
				<name><![CDATA[xxbaykov]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=2283</uri>
			</author>
			<updated>2022-12-22T16:44:26Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=4926#p4926</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Индикация]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=4906#p4906" />
			<content type="html"><![CDATA[<p>Посмотрите документацию, там есть примеры как это можно сделать <br /><a target="_blank" href="https://remotexy.com/en/help/indications/text/">https://remotexy.com/en/help/indications/text/</a><br /></p><div class="codebox"><pre><code>  double val = 1234.321;
  dtostrf(val, 0, 2, RemoteXY.text_1); // result: &quot;1234.32&quot;</code></pre></div>]]></content>
			<author>
				<name><![CDATA[remotexy]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=2</uri>
			</author>
			<updated>2022-12-17T09:03:46Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=4906#p4906</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Индикация]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=4902#p4902" />
			<content type="html"><![CDATA[<p>Подскажите как выполнить текстовую индикацию в проекте с отображением десятых и сотых долей? Обычно получается вывести только целые числа. Необходимо вывести показания датчика давления воды через ESP8266 на телефон с использованием программы FLProg</p>]]></content>
			<author>
				<name><![CDATA[xxbaykov]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=2283</uri>
			</author>
			<updated>2022-12-13T07:51:32Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=4902#p4902</id>
		</entry>
</feed>
