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

View File

@ -1,6 +1,6 @@
#include "Thermometer.h" #include "Thermometer.h"
using Thermometer; using namespace nsThermometer;
Thermometer::Thermometer() { Thermometer::Thermometer() {

View File

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

View File

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