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