1
2
3
4
5
6
7int Vodka = 2;
8int Cointreau = 3;
9int CranberryJuice = 4;
10int Sprite = 5;
11int LemonJuice = 6;
12int SugarWater = 7;
13int BlueCur = 8;
14int Gin = 9;
15
16
17
18int state = 0;
19
20int TimeBetweenPours = 500;
21
22
23void setup()
24{
25
26 Serial.begin(9600);
27 Serial.println("The bluetooth gates are open.\
28 Connect to HC-05 from any other bluetooth device with 1234 as pairing key!");
29
30
31 pinMode(2, OUTPUT);
32 pinMode(3, OUTPUT);
33 pinMode(4, OUTPUT);
34 pinMode(5, OUTPUT);
35 pinMode(6, OUTPUT);
36 pinMode(7, OUTPUT);
37 pinMode(8, OUTPUT);
38 pinMode(9, OUTPUT);
39
40
41
42
43 digitalWrite(2,HIGH);
44 digitalWrite(3,HIGH);
45 digitalWrite(4,HIGH);
46 digitalWrite(5,HIGH);
47 digitalWrite(6,HIGH);
48 digitalWrite(7,HIGH);
49 digitalWrite(8,HIGH);
50 digitalWrite(9,HIGH);
51
52
53}
54
55void loop()
56
57{
58if(Serial.available() > 0){
59 state = Serial.read();
60 Serial.println(state);
61}
62
63
64
65
66
67if (state == 'a') {
68 Serial.println("Vodka Sprite in the making");
69 Mix(3000,0,0,0,5000,0,0,0);
70 }
71
72
73if (state == 'b') {
74 Serial.println("Blue Lagoon in the making");
75 Mix(2000,0,0,5000,1800,1000,1800,0);
76 }
77
78
79
80if (state == 'c') {
81 Serial.println("Cosmo in the making");
82 Mix(2500,1500,3800,0,1200,1200,0,0);
83 }
84
85
86if (state == 'd') {
87 Serial.println("Lemon drop in the making");
88 Mix(1500,1500,0,0,1800,1200,0,0);
89 }
90
91
92if (state == 'e') {
93 Serial.println("Blue Moon in the making");
94 Mix(2000,0,3000,0,1800,1200,1200,0);
95 }
96
97
98if (state == 'f') {
99 Serial.println("Blue Gin Moon in the making");
100 Mix(0,0,3000,0,1800,1200,1200,2000);
101 }
102
103
104if (state == 'i') {
105 Serial.println("Double Strike in the making");
106 Mix(2000,0,3000,0,1800,0,1200,0);
107 }
108
109
110if (state == 'h') {
111 Serial.println("Tom Collins in the making");
112 Mix(0,0,0,4000,1800,1800,0,2200);
113 }
114
115
116if (state == 'g') {
117 Serial.println("Flying Dutchman in the making");
118 Mix(0,2000,0,0,1200,1000,0,2000);
119 }
120
121
122if (state == 'j') {
123 Serial.println("London Cosmo in the making");
124 Mix(0,2000,5000,1800,0,0,0,2000);
125 }
126
127
128
129if (state == 'k') {
130 Serial.println("Vodka Cranberry in the making");
131 Mix(2000,0,5000,0,0,1200,0,0);
132 }
133
134
135if (state == 'l') {
136 Serial.println("Cranberry Gin in the making");
137 Mix(0,0,5000,0,2000,0,0,2200);
138 }
139
140
141
142
143if (state == 'm') {
144 Serial.println("Set-up Vodka");
145 Mix(1100,0,0,0,0,0,0,0);
146 }
147
148
149if (state == 'n') {
150 Serial.println("Set-up Tripple Sec");
151 Mix(0,1100,0,0,0,0,0,0);
152 }
153
154
155if (state == 'o') {
156 Serial.println("Set-up Cranberry juice");
157 Mix(0,0,1000,0,0,0,0,0);
158 }
159
160
161if (state == 'p') {
162 Serial.println("Set-up Sprite");
163 Mix(0,0,0,1000,0,0,0,0);
164 }
165
166
167if (state == 'q') {
168 Serial.println("Set-up Lime juice");
169 Mix(0,0,0,0,1100,0,0,0);
170 }
171
172
173if (state == 'v') {
174 Serial.println("Set-up Sugar water");
175 Mix(0,0,0,0,0,1200,0,0);
176 }
177
178
179if (state == 'r') {
180 Serial.println("Set-up Blue curacao");
181 Mix(0,0,0,0,0,0,800,0);
182 }
183
184
185if (state == 's') {
186 Serial.println("Set-up Gin");
187 Mix(0,0,0,0,0,0,0,1000);
188 }
189
190
191if (state == 't') {
192 Serial.println("Set-up Gin");
193 Mix(4000,4000,4000,4000,4000,4000,4000,4000);
194 }
195
196
197if (state == 'u') {
198 Serial.println("Set-up All");
199 Mix(800,800,800,800,1000,1600,800,800);
200 }
201
202}
203
204void Mix(int DelayTimeVodka, int DelayTimeCointreau, int DelayTimeCranberryJuice, int DelayTimeSprite, int DelayTimeLemonJuice, int DelayTimeSugarWater, int DelayTimeBlueCur, int DelayTimeGin ) {
205
206 state = 0;
207 delay(800);
208 digitalWrite(Vodka, LOW);
209 delay(DelayTimeVodka);
210 digitalWrite(Vodka, HIGH);
211 delay(TimeBetweenPours);
212
213 digitalWrite(Cointreau, LOW);
214 delay(DelayTimeCointreau);
215 digitalWrite(Cointreau, HIGH);
216 delay(TimeBetweenPours);
217
218 digitalWrite(CranberryJuice, LOW);
219 delay(DelayTimeCranberryJuice);
220 digitalWrite(CranberryJuice, HIGH);
221 delay(TimeBetweenPours);
222
223 digitalWrite(Sprite, LOW);
224 delay(DelayTimeSprite);
225 digitalWrite(Sprite, HIGH);
226 delay(TimeBetweenPours);
227
228 digitalWrite(LemonJuice, LOW);
229 delay(DelayTimeLemonJuice);
230 digitalWrite(LemonJuice, HIGH);
231 delay(TimeBetweenPours);
232
233 digitalWrite(SugarWater, LOW);
234 delay(DelayTimeSugarWater);
235 digitalWrite(SugarWater, HIGH);
236 delay(TimeBetweenPours);
237
238 digitalWrite(BlueCur, LOW);
239 delay(DelayTimeBlueCur);
240 digitalWrite(BlueCur, HIGH);
241 delay(TimeBetweenPours);
242
243 digitalWrite(Gin, LOW);
244 delay(DelayTimeGin);
245 digitalWrite(Gin, HIGH);
246 delay(TimeBetweenPours);
247
248
249 Serial.println("Drink is done!");
250 state = 0;
251}