-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsetupmenu.ino
More file actions
139 lines (131 loc) · 4.65 KB
/
setupmenu.ino
File metadata and controls
139 lines (131 loc) · 4.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
// Setup Menu for user defined variables
//
// ATmega328P has 1024 bytes of EEPROM, values are from 0-1023
//
// 0 = testmode (DEFAULT 0, SET TO 1 TO ENABLE SKIP STEP) When testmode is enabled you can skip thru steps in AutoMode by pressing button 2
// 1 = countdowntimer (DEFAULT 0, SET BETWEEN 0-255 FOR DELAY AT START OF AUTOMODE)
// 2 = checkfloat (DEFAULT 1, SET TO 0 IF YOU DON'T REQUIRE CHECKING OF THE FLOAT SWITCH)
// 3 = striketemp (DEFAULT 0, OTHERWISE MANUALLY SET)
// 4 = targetmashtemp (DEFAULT 63-69)
// 5 = fudgefactor (DEFAULT 5)
// 6 = graintowaterratio (DEFAULT 3)
// 7 = spargetemp (DEFAULT 98)
// 8 = doughinpumpruntime (DEFAULT 9) ***
// 9 = mashlength (DEFAULT 60)
// 10 = mashoutpumpruntime (DEFAULT 6) ***
// 11 = mashoutstirtime (DEFAULT 5)
// 12 = mashoutresttime (DEFAULT 10)
// 13 = vorlaufpumpruntime (DEFAULT 10) ***
// 14 = fillkettlepumpruntime (DEFAULT 11) ***
// 15 = boiltemp (DEFAULT 99)
// 16 = boillength (DEFAULT 90)
// 17 = hopaddition1 (DEFAULT 60)
// 18 = hopaddition2 (DEFAULT 15)
// 19 = hopaddition3 (DEFAULT 5)
// 20 = endofboilresttime (DEFAULT 5)
void setupmenu()
{
const char* setupmenutext[]={"Test Mode ",
"Countdown Timer ",
"Check Float ",
"Strike Temp ",
"Target Mash Temp ",
"Fudge Factor ",
"Grain 2 Water Ratio",
"Sparge Water Temp ",
"Doughin Pump Time ",
"Mash Length ",
"Mashout Pump Time ",
"Mashout Stir Time ",
"Mashout Rest Time ",
"Vorlauf Pump Time ",
"FillKettle Pmp Time",
"Boil Temp ",
"Boil Length ",
"Hop Addition 1 ",
"Hop Addition 2 ",
"Hop Addition 3 ",
"EndofBoil Rest Time"};
byte saveflagchanged = false;
byte empromvalue;
byte empromlocation = 0;
empromvalue = EEPROM.read(empromlocation);
delay(100);
Serial.print("?f");
Serial.print(setupmenutext[empromlocation]); // print some text relavent here to correspond with the location number being changed
delay(100);
Serial.print("?x00?y1"); // put cursor here
delay(100);
Serial.print(empromvalue, DEC);
delay(100);
Serial.print("?x00?y3UP DOWN SAVE NEXT");
// 12345678901234567890
delay (500);
while(1)
{
if (Serial.available() > 0)
{
incoming = Serial.read();
}
else
{
incoming = 0;
}
if ((button1.uniquePress()) || ((char)incoming == '1'))
{
empromvalue++; // increment value
Serial.print("?x00?y1..."); //clear 3 digits space
delay(100);
Serial.print("?x00?y1"); // put cursor here
delay(100);
Serial.print(empromvalue, DEC); // print value on screen
delay(100);
saveflagchanged=true;
}
if ((button2.uniquePress()) || ((char)incoming == '2'))
{
empromvalue--; // increment value
Serial.print("?x00?y1...");
delay(100);
Serial.print("?x00?y1");
delay(100);
Serial.print(empromvalue, DEC);
delay(100);
saveflagchanged=true;
}
if ((button3.uniquePress()) || ((char)incoming == '3'))
{
EEPROM.write(empromlocation, empromvalue); // this writes the value "empromvalue" into "empromlocation"
}
if ((button4.uniquePress()) || ((char)incoming == '4'))
{
empromlocation++; // advance to the next address of the EEPROM
Serial.print("?x00?y0");
Serial.print(setupmenutext[empromlocation]); // print some text relavent here to correspond with the location number being changed
delay(100);
empromvalue = EEPROM.read(empromlocation);
delay(100);
Serial.print("?x00?y1...");
delay(100);
Serial.print("?x00?y1");
delay(100);
Serial.print(empromvalue, DEC);
if (empromlocation == 21) // once it gets to eeprom location 22 then return back to main menu
return;
}
if (saveflagchanged=true)
{
if (empromvalue != EEPROM.read(empromlocation))
{
Serial.print("?x14?y3*");
delay(100);
}
else
{
Serial.print("?x14?y3 ");
delay(100);
}
saveflagchanged=false; //don't update display until value changes again
}
}
}