major reorg

This commit is contained in:
hg
2014-02-25 17:32:23 +01:00
parent 0c111dd818
commit 15cc422fc1
8 changed files with 243 additions and 102 deletions

44
thermometer.h Normal file
View File

@ -0,0 +1,44 @@
/*
* thermometer.h
*
* Created on: 24.02.2014
* Author: wn
*/
#ifndef THERMOMETER_H_
#define THERMOMETER_H_
#include <Metro.h>
#include "cmd.h"
const bool DEBUG = false;
const bool INFO = true;
const unsigned long DEFAULT_PERIOD = 10000;
const unsigned int NUM_OF_CHANNELS = 4;
const unsigned long N_MAX = 0xffffff;
const float R_REF = 6000.0;
const float PT1000_R0 = 1000.0;
const float PT1000_Coeff = 3.85e-3;
const unsigned long CONV_TIMEOUT = 0xfffff;
class Thermometer {
public:
Thermometer();
void begin(CmdServer *cmdServer);
void exec();
private:
Metro m_period;
unsigned long m_n[NUM_OF_CHANNELS];
float m_calibrateFactor[NUM_OF_CHANNELS];
float m_temperature[NUM_OF_CHANNELS];
unsigned long m_timeOutFailureCnt;
void setTemperature(unsigned int index, float t);
};
#endif /* THERMOMETER_H_ */