const int goodButtonPin = 2;
const int badButtonPin = 11;
const int goodLedPin = 4;
const int badLedPin = 8;
int goodCount = 0;
int badCount = 0;
void setup() {
pinMode(goodButtonPin, INPUT_PULLUP);
pinMode(badButtonPin, INPUT_PULLUP);
pinMode(goodLedPin, OUTPUT);
pinMode(badLedPin, OUTPUT);
digitalWrite(goodLedPin, LOW);
digitalWrite(badLedPin, LOW);
Serial.begin(9600);
}
void loop() {
if (digitalRead(goodButtonPin) == 0) {
goodCount++;
digitalWrite(goodLedPin, HIGH);
delay(500);
digitalWrite(goodLedPin, LOW);
}
if (digitalRead(badButtonPin) == 0) {
badCount++;
digitalWrite(badLedPin, HIGH);
delay(500);
digitalWrite(badLedPin, LOW);
}
if (millis() % 10000 == 0) {
Serial.println("=============");
Serial.print("Good Feedback Count:");
Serial.print(goodCount);
Serial.print("Bad Feedback Count:");
Serial.println(badCount);
Serial.print("===============");
}
}