Browse Source

Merged in maestr0pl/espurna/feature/temperature-correction (pull request #39)

Conflicts:
	code/espurna/data/index.html.gz
	code/espurna/static/index.html.gz.h
fastled
Xose Pérez 7 years ago
parent
commit
d46d6bcff7
8 changed files with 2417 additions and 2393 deletions
  1. +1
    -0
      code/espurna/config/general.h
  2. BIN
      code/espurna/data/index.html.gz
  3. +2
    -1
      code/espurna/dht.ino
  4. +4
    -0
      code/espurna/ds18b20.ino
  5. +2397
    -2391
      code/espurna/static/index.html.gz.h
  6. +1
    -0
      code/espurna/ws.ino
  7. +3
    -1
      code/html/custom.js
  8. +9
    -0
      code/html/index.html

+ 1
- 0
code/espurna/config/general.h View File

@ -246,6 +246,7 @@ PROGMEM const char* const custom_reset_string[] = {
#define TMP_CELSIUS 0
#define TMP_FAHRENHEIT 1
#define TMP_UNITS TMP_CELSIUS // Temperature units (TMP_CELSIUS | TMP_FAHRENHEIT)
#define TMP_CORRECTION 0.0
//------------------------------------------------------------------------------
// LED


BIN
code/espurna/data/index.html.gz View File


+ 2
- 1
code/espurna/dht.ino View File

@ -187,7 +187,8 @@ void dhtLoop() {
if (readDHT(DHT_PIN, DHT_TYPE) == DHT_OK) {
unsigned char tmpUnits = getSetting("tmpUnits", TMP_UNITS).toInt();
double t = getDHTTemperature(tmpUnits == TMP_CELSIUS);
double tmpCorrection = getSetting("tmpCorrection", TMP_CORRECTION).toFloat();
double t = getDHTTemperature(tmpUnits == TMP_CELSIUS) + tmpCorrection;
unsigned int h = getDHTHumidity();
char temperature[6];


+ 4
- 0
code/espurna/ds18b20.ino View File

@ -87,10 +87,14 @@ void dsLoop() {
last_update = millis();
unsigned char tmpUnits = getSetting("tmpUnits", TMP_UNITS).toInt();
double tmpCorrection = getSetting("tmpCorrection", TMP_CORRECTION).toFloat();
// Read sensor data
double t = (tmpUnits == TMP_CELSIUS) ? ds18b20.getTempCByIndex(0) : ds18b20.getTempFByIndex(0);
// apply temperature reading correction
t = t + tmpCorrection;
// Check if readings are valid
if (isnan(t) || t < -50) {


+ 2397
- 2391
code/espurna/static/index.html.gz.h
File diff suppressed because it is too large
View File


+ 1
- 0
code/espurna/ws.ino View File

@ -296,6 +296,7 @@ void _wsStart(uint32_t client_id) {
root["btnDelay"] = getSetting("btnDelay", BUTTON_DBLCLICK_DELAY).toInt();
root["webPort"] = getSetting("webPort", WEB_PORT).toInt();
root["tmpUnits"] = getSetting("tmpUnits", TMP_UNITS).toInt();
root["tmpCorrection"] = getSetting("tmpCorrection", TMP_CORRECTION).toFloat();
// Callbacks
for (unsigned char i = 0; i < _ws_on_send_callbacks.size(); i++) {


+ 3
- 1
code/html/custom.js View File

@ -734,7 +734,9 @@ function processData(data) {
if (key == "tmpUnits") {
$("span#tmpUnit").html(data[key] == 1 ? "ºF" : "ºC");
}
if (key == "tmpCorrection") {
$("span#tmpCorrection").val(data[key]);
}
// Look for INPUTs
var element = $("input[name=" + key + "]");
if (element.length > 0) {


+ 9
- 0
code/html/index.html View File

@ -428,6 +428,15 @@
<div class="pure-u-1 pure-u-sm-1-4"><input type="radio" name="tmpUnits" tabindex="16" value="1"> Fahrenheit (&deg;F)</input></div>
</div>
<div class="pure-g module module-ds module-dht">
<label class="pure-u-1 pure-u-md-1-4" for="tmpCorrection">Temperature correction</label>
<input name="tmpCorrection" class="pure-u-1 pure-u-md-3-4" type="number" action="reset" min="-100" step="0.1" max="100" tabindex="6" />
<div class="pure-u-0 pure-u-md-1-4">&nbsp;</div>
<div class="pure-u-1 pure-u-md-3-4 hint">
Temperature correction value is added to the measured value which may be inaccurate due to many factors. The value can be negative.
</div>
</div>
</fieldset>
</div>
</div>


Loading…
Cancel
Save