const int irSensorPin = 26;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
pinMode(irSensorPin, INPUT);
Serial.println("IR Sensor Test");
Serial.println("Object Detection Status:");
}
void loop() {
// put your main code here, to run repeatedly:
int sensorState = digitalRead(irSensorPin);
if(sensorState == LOW){
Serial.println("Object Detected !!!");
} // this speeds up the simulation
else{
Serial.println("Object Not Detected !!!")
}
}