-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCustomer_Satisfaction_2023.ino
93 lines (70 loc) · 1.62 KB
/
Customer_Satisfaction_2023.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
int RED=9;
int GREEN=10;
int YELLOW=11;
int buttonRed=3;
int buttonGreen=4;
int buttonYellow=5;
int readv1;
int readv2;
int readv3;
//String id;
void setColor(int R ,int G,int Y){
analogWrite(RED,R);
analogWrite(GREEN,G);
analogWrite(YELLOW,Y);}
void setup() {
// put your setup code here, to run once:
pinMode(buttonRed,INPUT_PULLUP);
pinMode(buttonGreen,INPUT_PULLUP);
pinMode(buttonYellow,INPUT_PULLUP);
pinMode(RED,OUTPUT);
pinMode(GREEN,OUTPUT);
pinMode(YELLOW,OUTPUT);
//analogWrite(RED,255);
//analogWrite(GREEN,255);
//analogWrite(BLUE,255);
Serial.begin(9600);
}
void loop() {
readv1=digitalRead(buttonRed);
readv2=digitalRead(buttonGreen);
readv3=digitalRead(buttonYellow);
/*Serial.println(readv1);
Serial.println(readv2);
Serial.println(readv3);*/
String name1;
String branch;
if (Serial.available() > 0) {
name1=Serial.readString();
Serial.print("YOUR NAME IS ");
Serial.print(name1);
delay(4000);
branch=Serial.readString();
Serial.print("YOUR branch IS ");
Serial.print(branch);
}
if (readv1==0){
delay(500);
setColor(255,0,0);
delay(500);
Serial.println("unsatisfied");
}
if(readv1==1 )
setColor(0,0,0);
if (readv2==0 ){
delay(500);
setColor(0,255,0);
delay(500);
Serial.println("Satisfied");
}
if(readv2==1 )
setColor(0,0,0);
if (readv3==0 ){
delay(500);
setColor(255,255,0);
delay(500);
Serial.println("Neutral");
}
if(readv3==1 )
setColor(0,0,0);
}