mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-27 20:56:35 +00:00
Added configuration variables as #defines in my_user_config.h
Code in driver changed to se new config vars.
This commit is contained in:
parent
475f208cdc
commit
2b4d2f5bba
@ -429,6 +429,12 @@
|
|||||||
|
|
||||||
#define USE_MAX31865 // Add support for MAX31865 RTD sensors using softSPI
|
#define USE_MAX31865 // Add support for MAX31865 RTD sensors using softSPI
|
||||||
|
|
||||||
|
#ifdef USE_MAX31865
|
||||||
|
#define MAX31865_PTD_WIRES 2 // PTDs come in several flavors. Pick yours
|
||||||
|
#define MAX31865_PTD_RES 100 // Nominal PTD resistance at 0°C (100Ω for a PT100, 1000Ω for a PT1000, YMMV!)
|
||||||
|
#define MAX31865_REF_RES 430 // Reference resistor (Usually 430Ω for a PT100, 4300Ω for a PT1000)
|
||||||
|
#endif
|
||||||
|
|
||||||
// -- IR Remote features --------------------------
|
// -- IR Remote features --------------------------
|
||||||
#define USE_IR_REMOTE // Send IR remote commands using library IRremoteESP8266 and ArduinoJson (+4k3 code, 0k3 mem, 48 iram)
|
#define USE_IR_REMOTE // Send IR remote commands using library IRremoteESP8266 and ArduinoJson (+4k3 code, 0k3 mem, 48 iram)
|
||||||
// #define USE_IR_SEND_AIWA // Support IRsend Aiwa protocol
|
// #define USE_IR_SEND_AIWA // Support IRsend Aiwa protocol
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
xsns_39_MAX31865.ino - MAX31865 thermocouple sensor support for Sonoff-Tasmota
|
xsns_39_MAX31865.ino - MAX31865 thermocouple sensor support for Sonoff-Tasmota
|
||||||
|
|
||||||
Copyright (C) 2019 Alberto Lopez
|
Copyright (C) 2019 Alberto Lopez Siemens
|
||||||
Based on original code for MAx31855 written by Markus Past
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -18,15 +17,18 @@
|
|||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//#if defined(USE_MAX31855) || defined(USE_MAX31865)
|
|
||||||
|
|
||||||
#ifdef USE_MAX31865
|
#ifdef USE_MAX31865
|
||||||
#include "Adafruit_MAX31865.h"
|
#include "Adafruit_MAX31865.h"
|
||||||
|
|
||||||
#define XSNS_47 47
|
#define XSNS_47 47
|
||||||
|
|
||||||
#define RTD0 104.0 // Temperature at 0 degrees Celcius
|
#if MAX31865_PTD_WIRES == 4
|
||||||
#define RREF 430.0
|
#define PTD_WIRES MAX31865_4WIRE
|
||||||
|
#elif MAX31865_PTD_WIRES == 3
|
||||||
|
#define PTD_WIRES MAX31865_3WIRE
|
||||||
|
#else
|
||||||
|
#define PTD_WIRES MAX31865_2WIRE
|
||||||
|
#endif
|
||||||
|
|
||||||
int8_t init_status = 0;
|
int8_t init_status = 0;
|
||||||
|
|
||||||
@ -49,7 +51,7 @@ void MAX31865_Init(void){
|
|||||||
pin[GPIO_SSPI_SCLK]
|
pin[GPIO_SSPI_SCLK]
|
||||||
);
|
);
|
||||||
|
|
||||||
if(max31865.begin(MAX31865_2WIRE))
|
if(max31865.begin(PTD_WIRES))
|
||||||
init_status = 1;
|
init_status = 1;
|
||||||
else
|
else
|
||||||
init_status = -1;
|
init_status = -1;
|
||||||
@ -61,7 +63,7 @@ void MAX31865_Init(void){
|
|||||||
*/
|
*/
|
||||||
void MAX31865_GetResult(void){
|
void MAX31865_GetResult(void){
|
||||||
MAX31865_Result.PtdResistance = max31865.readRTD();
|
MAX31865_Result.PtdResistance = max31865.readRTD();
|
||||||
MAX31865_Result.PtdTemp = max31865.rtd_to_temperature(MAX31865_Result.PtdResistance, RTD0, RREF);
|
MAX31865_Result.PtdTemp = max31865.rtd_to_temperature(MAX31865_Result.PtdResistance, MAX31865_PTD_RES, MAX31865_REF_RES);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MAX31865_Show(bool Json){
|
void MAX31865_Show(bool Json){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user