dd
Dependencies: BufferedSerial FastAnalogIn FastPWM mbed SHT75
Diff: controlt.h
- Revision:
- 2:4c51394fb35b
- Parent:
- 1:5c42ec7f1aeb
- Child:
- 3:72644690e2e6
--- a/controlt.h Mon Feb 22 06:03:11 2016 +0000 +++ b/controlt.h Wed Mar 02 16:33:23 2016 +0000 @@ -8,6 +8,7 @@ #ifndef CONTROLT_H_ #define CONTROLT_H_ +#include "BufferedSerial.h" #include "tempsensort.h" #include "peltiert.h" @@ -32,6 +33,7 @@ float get_I_value(); float get_D_value(); float get_PWM_value(); + int get_table_count(); float calc_P(); float calc_I(); @@ -39,8 +41,10 @@ void write_log(); + void print_table(); + control_t(); - control_t(temp_sensor_t* _temp_sensor, peltier_t* _peltier); + control_t(temp_sensor_t* _temp_sensor, peltier_t* _peltier,BufferedSerial* _pc); virtual ~control_t(); private: float P_value; @@ -54,15 +58,18 @@ float dif; float temp_log[10]; + float PWM_log[10]; int log_count; float table[201]; int table_count; - int table_min; - int table_max; - + int table_mode; + + void build_table(); + temp_sensor_t* temp_sensor; peltier_t* peltier; + BufferedSerial *pc; int mode;//0: stop 1: set pwm 2: set temp };