111

Dependencies:   BufferedSerial FastPWM mbed

Committer:
sbh9428
Date:
Tue Apr 12 06:52:10 2016 +0000
Revision:
0:f3108add3d98
11

Who changed what in which revision?

UserRevisionLine numberNew contents of line
sbh9428 0:f3108add3d98 1 /*
sbh9428 0:f3108add3d98 2 * controlt.h
sbh9428 0:f3108add3d98 3 *
sbh9428 0:f3108add3d98 4 * Created on: 2016. 2. 19.
sbh9428 0:f3108add3d98 5 * Author: sbh9428
sbh9428 0:f3108add3d98 6 */
sbh9428 0:f3108add3d98 7
sbh9428 0:f3108add3d98 8 #ifndef CONTROLT_H_
sbh9428 0:f3108add3d98 9 #define CONTROLT_H_
sbh9428 0:f3108add3d98 10
sbh9428 0:f3108add3d98 11 #include "BufferedSerial.h"
sbh9428 0:f3108add3d98 12 #include "humsensort.h"
sbh9428 0:f3108add3d98 13 #include "pumpt.h"
sbh9428 0:f3108add3d98 14
sbh9428 0:f3108add3d98 15 class control_t {
sbh9428 0:f3108add3d98 16 public:
sbh9428 0:f3108add3d98 17 void setP(float _P);
sbh9428 0:f3108add3d98 18 void setI(float _I);
sbh9428 0:f3108add3d98 19 void setD(float _D);
sbh9428 0:f3108add3d98 20
sbh9428 0:f3108add3d98 21 void setMode(int _mode);
sbh9428 0:f3108add3d98 22
sbh9428 0:f3108add3d98 23 void setPower(float _power);
sbh9428 0:f3108add3d98 24 void setRatio(float _ratio);
sbh9428 0:f3108add3d98 25
sbh9428 0:f3108add3d98 26 float getP();
sbh9428 0:f3108add3d98 27 float getI();
sbh9428 0:f3108add3d98 28 float getD();
sbh9428 0:f3108add3d98 29
sbh9428 0:f3108add3d98 30 int getMode();
sbh9428 0:f3108add3d98 31
sbh9428 0:f3108add3d98 32 float getPower();
sbh9428 0:f3108add3d98 33 float getRatio();
sbh9428 0:f3108add3d98 34
sbh9428 0:f3108add3d98 35 void refreshPWM();
sbh9428 0:f3108add3d98 36
sbh9428 0:f3108add3d98 37 float calculatePID();
sbh9428 0:f3108add3d98 38
sbh9428 0:f3108add3d98 39 control_t();
sbh9428 0:f3108add3d98 40 control_t(pump_t *_dry, pump_t *_wet, humSensor_t *_humSensor, BufferedSerial *_pc);
sbh9428 0:f3108add3d98 41 virtual ~control_t();
sbh9428 0:f3108add3d98 42 private:
sbh9428 0:f3108add3d98 43 float P;
sbh9428 0:f3108add3d98 44 float I;
sbh9428 0:f3108add3d98 45 float D;
sbh9428 0:f3108add3d98 46
sbh9428 0:f3108add3d98 47 int mode;
sbh9428 0:f3108add3d98 48
sbh9428 0:f3108add3d98 49 float power;
sbh9428 0:f3108add3d98 50 float ratio;
sbh9428 0:f3108add3d98 51
sbh9428 0:f3108add3d98 52 float humidity;
sbh9428 0:f3108add3d98 53
sbh9428 0:f3108add3d98 54 float dryValue;
sbh9428 0:f3108add3d98 55 float wetValue;
sbh9428 0:f3108add3d98 56
sbh9428 0:f3108add3d98 57 humSensor_t *humSensor;
sbh9428 0:f3108add3d98 58
sbh9428 0:f3108add3d98 59 pump_t *dry;
sbh9428 0:f3108add3d98 60 pump_t *wet;
sbh9428 0:f3108add3d98 61
sbh9428 0:f3108add3d98 62 Ticker refresh;
sbh9428 0:f3108add3d98 63
sbh9428 0:f3108add3d98 64 BufferedSerial *pc;
sbh9428 0:f3108add3d98 65 };
sbh9428 0:f3108add3d98 66
sbh9428 0:f3108add3d98 67 #endif /* CONTROLT_H_ */
sbh9428 0:f3108add3d98 68
sbh9428 0:f3108add3d98 69
sbh9428 0:f3108add3d98 70