Coffee wish implemented with violet led indicator
This commit is contained in:
parent
a3f23d489a
commit
dd493d8fb9
11
main.c
11
main.c
@ -84,6 +84,9 @@ int main (void)
|
||||
if (make_coffee != 1)
|
||||
make_coffee = 3; // set coffee flag to 3 (1 coffee) else
|
||||
}
|
||||
else if(COFFEE_WISH) { // Save coffee wish
|
||||
make_coffee = 3;
|
||||
}
|
||||
}
|
||||
|
||||
else if (button_1_cup_counter < BUTTON_THRESHOLD
|
||||
@ -104,6 +107,9 @@ int main (void)
|
||||
if (make_coffee != 2)
|
||||
make_coffee = 4; // set coffee flag to 4 (2 coffee) else
|
||||
}
|
||||
else if(COFFEE_WISH) { // Save coffee wish
|
||||
make_coffee = 4;
|
||||
}
|
||||
}
|
||||
|
||||
if (water) // water OK:
|
||||
@ -186,7 +192,10 @@ int main (void)
|
||||
else // temperature too low:
|
||||
{
|
||||
clear_bit(TRIAC_BOILER_w, TRIAC_BOILER_pin); // boiler on
|
||||
led = RED_BLINK; // set red LED blink
|
||||
if (make_coffee > 0) // set red/blue LED blink if coffee wish is saved
|
||||
led = VIOLET_BLINK;
|
||||
else // set red LED blink if no coffee wish is saved
|
||||
led = RED_BLINK;
|
||||
}
|
||||
}
|
||||
else // water too low:
|
||||
|
3
main.h
3
main.h
@ -15,6 +15,7 @@
|
||||
#define TIME_1_COFFEE 26
|
||||
#define TIME_2_COFFEE 52
|
||||
#define OPERATING_TEMPERATURE 125 // ADC threshold for water temperature
|
||||
#define COFFEE_WISH 0 // save coffee wish while heating up
|
||||
/*
|
||||
*******************
|
||||
*/
|
||||
@ -103,6 +104,8 @@
|
||||
#define BLUE_BLINK 0b00100000
|
||||
#define ORANGE 0b00000101
|
||||
#define ORANGE_BLINK 0b00001010
|
||||
#define VIOLET 0b00010001
|
||||
#define VIOLET_BLINK 0b00100010
|
||||
|
||||
// prototypes:
|
||||
void init (); // initialization
|
||||
|
Loading…
x
Reference in New Issue
Block a user