Arduino, Cpp.
OUTPUT); pinMode(redLedPin, OUTPUT); pinMode(buzzerPin, OUTPUT); Serial.println("Infrared sensor test Arduino"); } void loop() { sensorState = digitalRead(sensorPin); if (sensorState == 0) { // Turn off the green LED and turn on the red LED digitalWrite(greenLedPin, LOW); digitalWrite(redLedPin,