-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsimulation code
More file actions
59 lines (37 loc) · 845 Bytes
/
Copy pathsimulation code
File metadata and controls
59 lines (37 loc) · 845 Bytes
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
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
const int currentPin = A0;
double adccurrent = 0;
double currentValue = 0;
const int rel = 2;
double power ;
void setup()
{lcd.init();
lcd.backlight();
Serial.begin(9600);
pinMode(rel, OUTPUT);
lcd.setCursor(0, 0);
lcd.print("Battery cooloing sys");
delay(2000);
}
void loop()
{
adccurrent = analogRead(currentPin);
currentValue = (adccurrent / 3) ;
lcd.setCursor(0, 0);
lcd.print("temp=");
lcd.setCursor(6, 0);
lcd.print(currentValue);
lcd.setCursor(11, 0);
lcd.print("Deg");
if (currentValue>=50)
{ digitalWrite(rel, HIGH);
lcd.setCursor(0, 1);
lcd.print("High tem pump on");
}
else{ digitalWrite(rel,LOW);
lcd.setCursor(0, 1);
lcd.print("nor tem pump off");
}
}