-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathread.ino
96 lines (81 loc) · 2.94 KB
/
read.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
int suctionpin = A0; // select the input pin for the sensor
int deliverypin=A1;
int flowpin=A2;
int amperepin=A3;
int powerpin=A4;
int pfpin=A5;
int buttonpin=9;
int voltagepin=A6;
int rpmpin=A7;
int temppin=A8;
// Author: Animish Murthy
// Date: 18/05/23
int suction, delivery, flow, ampere, power, pf, voltage, temp, rpm ; // variable to store the value coming from the sensor
int confirm=0;
long int t1, t2;
void setup() {
// declare the Pin as an OUTPUT or INPUT
Serial.begin(9600);
pinMode(suctionpin, INPUT);
pinMode(deliverypin, INPUT);
pinMode(flowpin, INPUT);
pinMode(amperepin, INPUT);
pinMode(powerpin, INPUT);
pinMode(pfpin, INPUT);
pinMode(buttonpin, INPUT);
pinMode(voltagepin, INPUT);
pinMode(rpmpin, INPUT);
}
void loop() {
// readS the value from the sensor IF button is pressed
confirm=digitalRead(buttonpin);
if (confirm==HIGH){
suction = analogRead(suctionpin);
delivery = analogRead(deliverypin);
flow = analogRead(flowpin);
ampere = analogRead(amperepin);
power = analogRead(powerpin);
pf = analogRead(pfpin);
voltage=analogRead(voltagepin);
temp=analogRead(temppin);
rpm=analogRead(rpmpin);
// Author: Animish Murthy
// Date: 18/05/23
// prints the text with commmas
Serial.print(rpm);
Serial.print(",");
Serial.print(suction);
Serial.print(",");
Serial.print(delivery);
Serial.print(",");
Serial.print(flow);
Serial.print(",");
Serial.print(ampere);
Serial.print(",");
Serial.print(power);
Serial.print(",");
Serial.print(pf);
Serial.print(",");
Serial.print(voltage);
Serial.print(",");
Serial.print(temp);
Serial.print('/n');
delay(1000);
}
}
// Author: Animish Murthy
// Date: 18/05/23
// _ _
// / \ \"""\ /"""/ / \
// / \ \ \ / / / \
// / \ \ \ / / / \
// / _ \ \ \ / / / _ \
// / / \ \ \ \ / / / / \ \
// / / \ \ \ \ / / / / \ \
// / / \ \ \ \ / / / / \ \
// / """"""" \ \ \ / / / """"""" \
// / \ \ \ / / / \
// / /"""""""""\ \ \ \ / / / /""""""""""\ \
// / / \ \ \ V / / / \ \
// / / \ \ \ / / / \ \
// """"" """"" """"" """"" """"