<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[RemoteXY community — too much delay on communication DS18B20 and some help]]></title>
	<link rel="self" href="https://forum.remotexy.com/extern.php?action=feed&amp;tid=391&amp;type=atom" />
	<updated>2018-02-17T16:09:04Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.remotexy.com/viewtopic.php?id=391</id>
		<entry>
			<title type="html"><![CDATA[Re: too much delay on communication DS18B20 and some help]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=1333#p1333" />
			<content type="html"><![CDATA[<p>Welcome <img src="https://forum.remotexy.com/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><p>delay() will block your program, hence the unresponsive UI. Instead use the method shown in the Blink Without Delay example.</p>]]></content>
			<author>
				<name><![CDATA[Guillaume]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=23</uri>
			</author>
			<updated>2018-02-17T16:09:04Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=1333#p1333</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[too much delay on communication DS18B20 and some help]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=1332#p1332" />
			<content type="html"><![CDATA[<p>hi there,</p><p>i&#039;m trying to use this to read a temperature from a sensor DS18B20 and write it on the app (which i already did) and also to control 3 or 4 relays (i have the pro app)</p><p>what is happening is that everytime i press the button on the app it takes like 5 or more seconds to change the state of the digital output</p><p>check my code:</p><div class="codebox"><pre><code>/********************************************************************/
// First we include the libraries
#include &lt;OneWire.h&gt; 
#include &lt;DallasTemperature.h&gt;
/********************************************************************/
// Data wire is plugged into pin 2 on the Arduino 
#define ONE_WIRE_BUS 2 
/********************************************************************/
// Setup a oneWire instance to communicate with any OneWire devices  
// (not just Maxim/Dallas temperature ICs) 
OneWire oneWire(ONE_WIRE_BUS); 
/********************************************************************/
// Pass our oneWire reference to Dallas Temperature. 
DallasTemperature sensors(&amp;oneWire);
/********************************************************************/ 
// RemoteXY select connection mode and include library  
#define REMOTEXY_MODE__ESP8266_HARDSERIAL_POINT

#include &lt;RemoteXY.h&gt; 

// RemoteXY connection settings  
#define REMOTEXY_SERIAL Serial 
#define REMOTEXY_SERIAL_SPEED 115200 
#define REMOTEXY_WIFI_SSID &quot;RemoteXY&quot; 
#define REMOTEXY_WIFI_PASSWORD &quot;12345678&quot; 
#define REMOTEXY_SERVER_PORT 6377 


// RemoteXY configurate   
#pragma pack(push, 1) 
uint8_t RemoteXY_CONF[] = 
  { 255,3,0,11,0,133,0,8,13,1,
  67,4,38,36,20,5,2,26,11,129,
  0,48,36,18,6,16,194,186,99,0,
  2,0,3,30,22,11,2,26,31,31,
  79,78,0,79,70,70,0,129,0,5,
  23,18,6,17,80,111,119,101,114,0,
  129,0,28,49,18,6,17,69,115,112,
  114,101,115,115,111,0,129,0,30,67,
  34,6,17,67,111,102,102,101,101,32,
  77,117,103,0,129,0,40,24,15,6,
  17,84,101,109,112,0,2,0,3,47,
  22,11,2,26,31,31,79,78,0,79,
  70,70,0,2,0,3,63,22,11,2,
  26,31,31,79,78,0,79,70,70,0 };  
   
// this structure defines all the variables of your control interface  
struct { 

   // input variable
  uint8_t power; // =1 if switch ON and =0 if OFF 
  uint8_t button_1; // =1 if switch ON and =0 if OFF 
  uint8_t button_2; // =1 if switch ON and =0 if OFF 


    // output variable
  char text_1[11];  // string UTF8 end zero 

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

} RemoteXY; 
#pragma pack(pop)

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

#define PIN_POWER 3
#define PIN_BUTTON_1 4
#define PIN_BUTTON_2 5


void setup(void) 
{ RemoteXY_Init ();
  pinMode (PIN_POWER, OUTPUT);
  pinMode (PIN_BUTTON_1, OUTPUT);
  pinMode (PIN_BUTTON_2, OUTPUT);
 // start serial port 
 Serial.begin(115200); 
 Serial.println(&quot;Dallas Temperature IC Control Library Demo&quot;); 
 // Start up the library 
 sensors.begin();
 sensors.setResolution (0, 10); //in here it ends the temperature reading/writing
} 
void loop(void) 
{  RemoteXY_Handler ();
  if (RemoteXY.button_1==1) {
       digitalWrite(4, LOW);
       delay(16000);
       digitalWrite(4, HIGH);
       
}
else{
       digitalWrite(4, HIGH);
       
}
 // call sensors.requestTemperatures() to issue a global temperature 
 // request to all devices on the bus 
   RemoteXY_Handler (); 
  sensors.requestTemperatures (); 
  float t1 = sensors.getTempCByIndex (0); 
  dtostrf (t1, 0, 1, RemoteXY.text_1); 
  delay (1000); //in here it ends the temperature reading/writing
} </code></pre></div><p>I&#039;m not a programmer so i have some difficulties with the code and i search and read and test a lot</p><p>i also want this</p><p>when i press button_1 and button_2 the output goes from HIGH to LOW for 16 seconds and then to HIGH again and stays like that till i press the buttons again, any help??</p><p>thanks a lot</p>]]></content>
			<author>
				<name><![CDATA[rafaelmatos90]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=558</uri>
			</author>
			<updated>2018-02-16T18:55:29Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=1332#p1332</id>
		</entry>
</feed>
