-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathProject_01.ino
115 lines (98 loc) · 2.35 KB
/
Project_01.ino
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
#include "thingProperties.h"
void setup() {
Serial.begin(9600);
delay(1500);
initProperties();
ArduinoCloud.begin(ArduinoIoTPreferredConnection);
setDebugMessageLevel(2);
ArduinoCloud.printDebugInfo();
pinMode(LED_BUILTIN, OUTPUT);
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
}
void loop() {
ArduinoCloud.update();
}
void onBloodyLogicChange() {
if (bloodyLogic == true)
{
Serial.println("Preparing Bloody Logic");
Serial.println("Preparing Digital Martini");
digitalWrite(LED_BUILTIN, HIGH);
pumpOn(2, 2);
pumpOn(3, 2);
pumpOn(5, 1);
Serial.println("Bloody Logic Ready!");
digitalWrite(LED_BUILTIN, LOW);
}
}
void onDigitalMartiniChange() {
if (digitalMartini == true)
{
Serial.println("Preparing Digital Martini");
digitalWrite(LED_BUILTIN, HIGH);
delay(1000);
pumpOn(3, 1);
pumpOn(4, 3);
pumpOn(2, 1);
Serial.println("Digital Martini Ready!");
digitalWrite(LED_BUILTIN, LOW);
}
}
void onRobot75Change() {
if (robot75 == true)
{
Serial.println("Preparing Robot 75");
digitalWrite(LED_BUILTIN, HIGH);
delay(1000);
pumpOn(5, 3);
pumpOn(2, 1);
pumpOn(4, 1);
Serial.println("Robot 75 Ready!");
digitalWrite(LED_BUILTIN, LOW);
}
}
void onRobotOnTheBeachChange() {
if (robotOnTheBeach == true)
{
Serial.println("Preparing Robot on the Beach");
digitalWrite(LED_BUILTIN, HIGH);
delay(1000);
pumpOn(5, 2);
pumpOn(2, 1);
pumpOn(3, 1);
pumpOn(4, 1);
Serial.println("Robot on the Beach Ready!");
digitalWrite(LED_BUILTIN, LOW);
}
}
void onCyberPunchChange() {
if (cyberPunch == true)
{
Serial.println("Preparing Cyber Punch");
digitalWrite(LED_BUILTIN, HIGH);
delay(1000);
pumpOn(2, 1);
pumpOn(4, 2);
pumpOn(3, 1);
pumpOn(2, 2);
Serial.println("Cyber Punch Ready!");
digitalWrite(LED_BUILTIN, LOW);
}
}
void pumpOn(int duration, int pin)
{
Serial.println("");
digitalWrite(pin, HIGH);
Serial.print("Turning On Pump - ");
Serial.print(pin);
Serial.print(" For ");
Serial.print(duration);
Serial.println("Seconds");
Serial.println("");
delay(duration);
digitalWrite(2, LOW);
delay(1000);
}