-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.ino
122 lines (107 loc) · 2.34 KB
/
test.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
116
117
118
119
120
void bsd_receiver ()
{
}
void receiver_serial_test()
{
Serial.print("Receiver 1: ");
Serial.println(analogRead(receiver_1));
Serial.print("Receiver 2: ");
Serial.println(analogRead(receiver_2));
Serial.print("Receiver 3: ");
Serial.println(analogRead(receiver_3));
Serial.print("Receiver 4: ");
Serial.println(analogRead(receiver_4));
delay(300);
}
void receiver_led_test()
{
if (disp == true)
{
if (analogRead(receiver_1) > 2)
{
digitalWrite(led_1,HIGH);
}
else
{
digitalWrite(led_1,LOW);
}
if (analogRead(receiver_2) > 2)
{
digitalWrite(led_2,HIGH);
}
else
{
digitalWrite(led_2,LOW);
}
}
else
{
digitalWrite(led_1,LOW);
digitalWrite(led_2,LOW);
digitalWrite(led_3,LOW);
digitalWrite(led_4,LOW);
digitalWrite(led_5,LOW);
}
// delay(300);
}
void receiver_lcd_test()
{
lcd.setCursor(0,0);
lcd.print(analogRead(receiver_1));
lcd.setCursor(8,0);
lcd.print(analogRead(receiver_2));
lcd.setCursor(0,1);
lcd.print(analogRead(receiver_3));
lcd.setCursor(8,1);
lcd.print(analogRead(receiver_4));
delay(300);
}
void sensor_serial_test()
{
lcd.clear();
lcd.setCursor(0,0);
lcd.print("LDR:");
lcd.setCursor(4,0);
lcd.print(analogRead(bottle_detect));
lcd.setCursor(0,1);
lcd.print("Temp: ");
lcd.setCursor(5,1);
lcd.print(analogRead(temperature));
delay(100);
}
void button_test()
{
Serial.print("Button 1: ");
Serial.println(digitalRead(button_1));
Serial.print("Button 2: ");
Serial.println(digitalRead(button_2));
Serial.print("Button 3: ");
Serial.println(digitalRead(button_3));
Serial.print("Button 4: ");
Serial.println(digitalRead(button_4));
Serial.print("Button 5: ");
Serial.println(digitalRead(button_5));
Serial.print("Button 6: ");
Serial.println(digitalRead(button_6));
Serial.println("\n\n");
delay(500);
}
void state_disp()
{
if (developers_mode)
{
Serial.print("ref_rel: ");
Serial.println(ref_rel);
Serial.print("pow_rel: ");
Serial.println(pow_rel);
Serial.print("temp_defined: ");
Serial.println(temp_defined);
Serial.print("override: ");
Serial.println(override);
Serial.print("disp: ");
Serial.println(disp);
Serial.print("developers_mode: ");
Serial.println(developers_mode);
delay(500);
}
}