<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[RemoteXY community — Simple DHT Display for my desk using ESP-01 and and old tablet.]]></title>
	<link rel="self" href="https://forum.remotexy.com/extern.php?action=feed&amp;tid=1328&amp;type=atom" />
	<updated>2023-01-11T08:05:08Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.remotexy.com/viewtopic.php?id=1328</id>
		<entry>
			<title type="html"><![CDATA[Re: Simple DHT Display for my desk using ESP-01 and and old tablet.]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=4956#p4956" />
			<content type="html"><![CDATA[<p>Hello Gunner!<br />Thank for this project!<br />I would like to use the graph in another DHT project, and use this graph.<br />Can you help me to set the graph &quot;Variabile name&quot;, and settings?<br /> I tried a lot of settings, but failed.<br />Thank you in advance!</p>]]></content>
			<author>
				<name><![CDATA[szaboferikraszna]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=2313</uri>
			</author>
			<updated>2023-01-11T08:05:08Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=4956#p4956</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Simple DHT Display for my desk using ESP-01 and and old tablet.]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=4293#p4293" />
			<content type="html"><![CDATA[<p>Thanks</p>]]></content>
			<author>
				<name><![CDATA[miletina]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=1965</uri>
			</author>
			<updated>2021-10-12T15:03:26Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=4293#p4293</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Simple DHT Display for my desk using ESP-01 and and old tablet.]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=4021#p4021" />
			<content type="html"><![CDATA[<p>As the title says, this is just a simple DHT based Temperature and Humidity desktop display that I made for my desk.</p><p>To keep the hardware simple, I used an ESP-01 connected to a DHT11 (I didn&#039;t have any spare DHT12) and an old Samsung 8&quot; Tablet that is much too slow for anything else.</p><p>The idea I had was for Arc Level gauges that dynamically change colour based on their ranges, via the RGB features of the LED as a background.&nbsp; But lack of Element background transparency became an issue.&nbsp; So this is what I currently have...</p><p><span class="postimg"><img src="https://www.dropbox.com/s/swkbtjk6jpd7ck8/ESP-01%20%20and%20DHT11.png?dl=1" alt="https://www.dropbox.com/s/swkbtjk6jpd7ck8/ESP-01%20%20and%20DHT11.png?dl=1" /></span></p><p>At the moment the LED colours are an extremely simple range between green and red for temperature and green and blue for Humidity.&nbsp; But I may work on a better colour range algorithm in time.</p><p>Enjoy.</p><div class="codebox"><pre><code>/*
   -- Temperature and Humidity --

   This source code of graphical user interface
   has been generated automatically by RemoteXY editor.
   To compile this code using RemoteXY library 2.4.3 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.7.12 or later version;
     - for iOS 1.4.7 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          //
//////////////////////////////////////////////

// RemoteXY select connection mode and include library
#define REMOTEXY_MODE__ESP8266WIFI_LIB_POINT
#include &lt;ESP8266WiFi.h&gt;

#include &lt;RemoteXY.h&gt;

// RemoteXY connection settings
#define REMOTEXY_WIFI_SSID &quot;ESP-01_Temp_Humid&quot;
#define REMOTEXY_WIFI_PASSWORD &quot;12345678&quot;
#define REMOTEXY_SERVER_PORT 6377


// RemoteXY configurate  
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
  { 255,0,0,38,0,128,0,11,24,0,
  130,1,18,3,26,24,25,130,1,1,
  29,98,32,25,68,18,3,31,94,28,
  26,1,190,65,31,20,5,22,20,66,
  132,19,4,24,19,26,16,130,0,27,
  12,8,8,26,67,1,26,13,10,6,
  1,24,11,129,0,20,23,22,3,16,
  84,69,77,80,69,82,65,84,85,82,
  69,0,130,1,56,3,26,24,25,65,
  31,58,5,22,20,66,132,57,4,24,
  19,26,16,130,0,65,12,8,8,26,
  67,1,63,13,12,6,190,27,11,129,
  0,62,23,14,3,16,72,85,77,73,
  68,73,84,89,0 };

// this structure defines all the variables and events of your control interface
struct {

  // output variables
  float temp_graph;
  float hum_graph;
  uint8_t temp_led_r; // =0..255 LED Red brightness
  uint8_t temp_led_g; // =0..255 LED Green brightness
  uint8_t temp_led_b; // =0..255 LED Blue brightness
  int8_t temp_level; // =0..100 level position
  char temp_txt[11];  // string UTF8 end zero
  uint8_t hum_led_r; // =0..255 LED Red brightness
  uint8_t hum_led_g; // =0..255 LED Green brightness
  uint8_t hum_led_b; // =0..255 LED Blue brightness
  int8_t hum_level; // =0..100 level position
  char hum_txt[11];  // string UTF8 end zero

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

} RemoteXY;
#pragma pack(pop)

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

#include &lt;Adafruit_Sensor.h&gt;
#include &lt;DHT.h&gt;

#define DHTPIN 0     // Digital pin connected to the DHT sensor

// Uncomment the type of sensor in use:
#define DHTTYPE    DHT11     // DHT 11
//#define DHTTYPE    DHT22     // DHT 22 (AM2302)
//#define DHTTYPE    DHT21     // DHT 21 (AM2301)

DHT dht(DHTPIN, DHTTYPE);

// current temperature &amp; humidity, updated in loop()
float t = 0.0;
float h = 0.0;

// Generally, you should use &quot;unsigned long&quot; for variables that hold time
// The value will quickly become too large for an int to store
unsigned long previousMillis = 0;    // will store last time DHT was updated

// Updates DHT readings every 10 seconds
const long interval = 10000;



void setup() {
  RemoteXY_Init ();
  dht.begin();
}



void loop() {
  RemoteXY_Handler ();

  unsigned long currentMillis = millis();
  if (currentMillis - previousMillis &gt;= interval) {
    // save the last time you updated the DHT values
    previousMillis = currentMillis;
    // Read temperature as Celsius (the default)
    float temperature = dht.readTemperature();
    // Read temperature as Fahrenheit (isFahrenheit = true)

    // if temperature read failed, don&#039;t change t value
    if (isnan(temperature)) {
      delay(10);
    }
    else {
      RemoteXY.temp_graph = temperature;
      RemoteXY.temp_level = temperature;
      dtostrf(temperature, 0, 0, RemoteXY.temp_txt);
      RemoteXY.temp_led_r = map(temperature,0,40,0,255);
      RemoteXY.temp_led_g = map(temperature,0,40,255,0);
    }
    // Read Humidity
    float humidity = dht.readHumidity();
    // if humidity read failed, don&#039;t change h value
    if (isnan(humidity)) {
      delay(10);
    }
    else {
      RemoteXY.hum_graph = humidity;
      RemoteXY.hum_level = humidity;
      dtostrf(humidity, 0, 0, RemoteXY.hum_txt);
      RemoteXY.hum_led_b = map(humidity,0,100,0,255);
      RemoteXY.hum_led_g = map(humidity,0,100,255,0);
    }
  }
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Gunner]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=1840</uri>
			</author>
			<updated>2021-06-02T06:06:01Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=4021#p4021</id>
		</entry>
</feed>
