dd
Dependencies: BufferedSerial FastAnalogIn FastPWM mbed SHT75
Diff: controlt.cpp
- Revision:
- 5:8e3b5ccf7207
- Parent:
- 4:7ca449fca19b
- Child:
- 6:c2fb5c188e8a
diff -r 7ca449fca19b -r 8e3b5ccf7207 controlt.cpp --- a/controlt.cpp Fri Mar 25 05:55:07 2016 +0000 +++ b/controlt.cpp Fri Mar 25 08:58:51 2016 +0000 @@ -107,7 +107,7 @@ void control_t::refresh_PWM() { write_log(); - printf("%f, %f, %f, %f, %d, %d, %d, %d, %f, %f\n", P_value, I_value, D_value, PWM_value, start_temp, period, time, mode, target_temp, temp_sensor->get_temp()); + printf("%f, %f, %f, %1.4f, %2.2f, %d, %d, %d, %d, %2.2f, %2.2f\n", P_value, I_value, D_value, PWM_value, start_temp, period, time, mode, target_temp, temp_sensor->get_temp()); if(mode==0) { PWM_value=0; @@ -205,7 +205,7 @@ { peltier->set_PWM(-1); table_count++; - pc->printf("set initial temp %d/30", table_count); + pc->printf("set initial temp %d/30\n", table_count); if(table_count>29) { table_mode=1; @@ -217,7 +217,8 @@ { table[table_count]=temp_sensor->get_temp(); table_count++; - peltier->set_PWM((float)-1+0.005*table_count); + PWM_value=(float)-1+0.005*table_count; + peltier->set_PWM(PWM_value); if(table_count>=200) { table_count=0; @@ -225,7 +226,7 @@ table_min=table[0]; table_max=table[199]; } - pc->printf("build table %d/200, PWM, temp is %1.3f", table_count,-1+0.005*table_count); + pc->printf("build table %d/200", table_count); } } @@ -273,7 +274,7 @@ { PWM_value=find_table(target_temp/period*step+start_temp/period*(period-step)); peltier->set_PWM(PWM_value); - printf("remain step, temp: %d",period-step); + printf("remain step: %d,",period-step); step++; } } \ No newline at end of file