const int excellentButtonPin = 17; // Pin for the button providing good feedback
const int goodButtonPin = 32; // Pin for the button providing bad feedback
const int averageButtonPin = 26; // Pin for the button providing bad feedback
int excellentCount = 0; // Counter for bad feedback
int goodCount = 0; // Counter for good feedback
int averageCount = 0; // Counter for bad feedback
void setup() {
pinMode(excellentButtonPin, INPUT_PULLUP);
pinMode(goodButtonPin, INPUT_PULLUP);
pinMode(averageButtonPin, INPUT_PULLUP);
Serial.begin(9600); // Initialize serial communication
}
void loop() {
// Check for Excellent feedback button press
if (digitalRead(excellentButtonPin) == LOW) {
excellentCount++; // Increment good feedback count
Serial.println("Excellent Feedback Received");
delay(1000);
}
// Check for good feedback button press
if (digitalRead(goodButtonPin) == LOW) {
goodCount++; // Increment good feedback count
Serial.println("Good Feedback Received");
delay(1000);
}
// Check for bad feedback button press
if (digitalRead(averageButtonPin) == LOW) {
averageCount++; // Increment bad feedback count
Serial.println("Average Feedback Received");
delay(1000);
}
// Print feedback counts every 5 seconds
if (millis() % 5000 == 0) {
Serial.println("===========================================================================================");
Serial.print("Excellent Feedback Count: ");
Serial.print(excellentCount);
Serial.print("\tGood Feedback Count: ");
Serial.print(goodCount);
Serial.print("\tAverage Feedback Count: ");
Serial.println(averageCount);
Serial.println("=========================================================================================");
}
}