-
Notifications
You must be signed in to change notification settings - Fork 0
/
Aqrm_Sketch_m1.ino
64 lines (59 loc) · 1.54 KB
/
Aqrm_Sketch_m1.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
/*Code definition for operation of tank waterlevel management using two pumps
**** Arduino nano
**** future upgrade -IOT
****
Pinout used
pins D4,D5,D6,D7 input levels
pins D2,D3 output actuator to relays
D4,D5 low,High for Main tank
D6,D7 low,High for Filter tank
*/
int mT_low = 4;
int mT_High = 5;
int fT_low = 6;
int fT_High = 7;
int pAct_mT = 2;
int pAct_fT = 3;
void setup()
{
// put your setup code here, to run once:
/*
Setup of pin modes for proper operations.
Code might be updated later for wifi monitoring and control using IoT parameters
*/
Serial.begin(9600); // Serial setup
pinMode(mT_low, INPUT); // pin modes declaration
pinMode(mT_High, INPUT);
pinMode(fT_low, INPUT);
pinMode(fT_High, INPUT);
pinMode(pAct_mT, OUTPUT);
pinMode(pAct_fT, OUTPUT);
} // end of setup section
void loop()
{
// put your main code here, to run repeatedly:
/*
input of button mode and immediate response impact
structured in separate if-else checks
## intricacies to be added later with Android packaging and control for IoT & Wifi.
*/
if (!digitalRead(mT_low))
digitalWrite(pAct_fT, HIGH);
if (!digitalRead(fT_low))
digitalWrite(pAct_mT, HIGH);
if (digitalRead(mT_High))
{
delay(1000);
digitalWrite(pAct_fT, LOW);
}
if (digitalRead(fT_High))
{
delay(1000);
digitalWrite(pAct_mT, LOW);
}
} //end of loop section
/*
code courtesy
@ Bishal Biswas
Github: https://github.com/WolfDev8675/RepoSJX2
*/