This commit is contained in:
hg
2014-11-15 23:07:02 +01:00
parent 96fec4e827
commit c687aff175
4 changed files with 5 additions and 9 deletions

View File

@ -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);

View File

@ -1,6 +1,6 @@
#include "Thermometer.h"
using Thermometer;
using namespace nsThermometer;
Thermometer::Thermometer() {
@ -16,4 +16,4 @@ void Thermometer::exec(float r) {
temperatureRaw = (r / PT1000_R0 - 1) / PT1000_Coeff;
}
}

View File

@ -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;

View File

@ -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);