diff --git a/barista/barista.ino b/barista/barista.ino index 1d0c416..fa4bd14 100644 --- a/barista/barista.ino +++ b/barista/barista.ino @@ -10,8 +10,8 @@ enum logic { }; #define DEBOUNCE_TIME 20L /* ms */ -#define TEMP_MIN 80.0f -#define TEMP_MAX 90.0f +#define TEMP_MIN 40.0f /* C */ +#define TEMP_MAX 50.0f /* C */ #define LED_MIN_VALUE 0 @@ -59,6 +59,7 @@ struct btn { }; struct input { + unsigned long t_ms; int ntc_V; enum logic btn[MAX_BTN]; } g_in; @@ -108,6 +109,8 @@ void setled(int pin, enum logic st) void do_input(struct input *input) { + input->t_ms = millis(); + /* Read buttons */ for (int i = 0; i < MAX_BTN; i++) input->btn[i] = read_input(button_pin[i]); @@ -169,7 +172,7 @@ int red_min = 50; int red_state = red_min; unsigned long brewing_time = 3000UL; /* 3 seconds */ unsigned long cooling_time = 3000UL; /* 3 seconds */ -unsigned long max_heating_time = 10000UL; /* 10 seconds */ +unsigned long max_heating_time = 60000UL; /* 60 seconds */ unsigned long max_idle_time = 10000UL; /* 10 seconds */ void proc_machine(struct state *st) @@ -178,7 +181,9 @@ void proc_machine(struct state *st) int on = (st->btn[BTN_ON].state == RELEASED); int hot = (st->btn[BTN_HOT].state == PRESSED); - Serial.print("state="); + Serial.print("t="); + Serial.print(millis()); + Serial.print(" state="); Serial.print(st->mstate); Serial.print(" on="); Serial.print(on);