fixes
This commit is contained in:
@ -59,10 +59,6 @@ struct {
|
|||||||
} modbusHoldingRegisters;
|
} modbusHoldingRegisters;
|
||||||
|
|
||||||
|
|
||||||
float pt1000(float r) {
|
|
||||||
return (r / PT1000_R0 - 1) / PT1000_Coeff;
|
|
||||||
}
|
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
delay(100);
|
delay(100);
|
||||||
led.begin(LED_PIN);
|
led.begin(LED_PIN);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#include "Thermometer.h"
|
#include "Thermometer.h"
|
||||||
|
|
||||||
using Thermometer;
|
using namespace nsThermometer;
|
||||||
|
|
||||||
Thermometer::Thermometer() {
|
Thermometer::Thermometer() {
|
||||||
|
|
||||||
@ -16,4 +16,4 @@ void Thermometer::exec(float r) {
|
|||||||
temperatureRaw = (r / PT1000_R0 - 1) / PT1000_Coeff;
|
temperatureRaw = (r / PT1000_R0 - 1) / PT1000_Coeff;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
namespace {
|
namespace nsThermometer {
|
||||||
const float R_REF = 3000.0;
|
const float R_REF = 3000.0;
|
||||||
const float PT1000_R0 = 1000.0;
|
const float PT1000_R0 = 1000.0;
|
||||||
const float PT1000_Coeff = 3.85e-3;
|
const float PT1000_Coeff = 3.85e-3;
|
||||||
|
@ -76,8 +76,8 @@ void ADS1210::exec() {
|
|||||||
|
|
||||||
value = res.out;
|
value = res.out;
|
||||||
|
|
||||||
u = ((float)(value / V_MAX)) * U_REF;
|
u = (((float)value) / ((float)V_MAX)) * U_REF;
|
||||||
r = (((float)(V_MAX / value)) - 1.0) * R_REF;
|
r = ((((float)V_MAX) / ((float)value)) - 1.0) * R_REF;
|
||||||
|
|
||||||
if (value == 0) {
|
if (value == 0) {
|
||||||
// fatal(2);
|
// fatal(2);
|
||||||
|
Reference in New Issue
Block a user