int main(void) { while (TRUE) { printf("\nTemperature Plotting Program Menu\n"); printf("\tE - Enter temperatures for scratchpad\n"); printf("\tS - Store scratchpad to disk\n"); printf("\tR - Read disk file to scratchpad\n"); printf("\tT - Table view of current data\n"); printf("\tG - Graph view of current data\n"); printf("\tX - Exit the program\n"); printf("\nPress one of the above keys: "); switch (toupper(getche())) { case 'E': get_temps(); break; case 'S': save_temps(); break; case 'R': read_temps(); break; case 'T': table_view(); break; case 'G': graph_view(); break; case 'X': exit(0); } } }
void HEATMINDER::run_boiler(float flow_set_temp) { uint32_t timer; digitalWrite(_SSR_pin, HIGH); Serial.print("Flow Temp = "); Serial.println(tempC_flow); timer = millis(); delay(120000); while(tempC_flow < flow_set_temp) { read_temps(); } Serial.print("Flow Temp = "); Serial.println(tempC_flow); Serial.print("Boiler ON (sec) = "); Serial.println((millis()-timer)/1000); digitalWrite(_SSR_pin, LOW); delay(60000); }
uint16_t HEATMINDER::ramp_up(DS1302 RTC, ramp_data* data, uint16_t data_index) { ds1302_struct time; uint16_t time1, time2; RTC.clock_burst_read( (uint8_t *) &time); time1 = 60*(bcd2bin(time.h24.Hour10, time.h24.Hour))+bcd2bin(time.Minutes10, time.Minutes); data[data_index].tempC_inside = tempC_inside; data[data_index].tempC_outside = tempC_outside; data[data_index].estimated_ramp_period_minute = determine_estimated_time(data, data_index); //time1 = millis(); while(tempC_inside < set_temp_evening_C) { run_boiler(weather_compensation()); read_temps(); } RTC.clock_burst_read( (uint8_t *) &time); time2 = 60*(bcd2bin(time.h24.Hour10, time.h24.Hour))+bcd2bin(time.Minutes10, time.Minutes); data[data_index].actual_ramp_period_minute = time2 - time1; data_index = data_index + 1; return data_index; }