//IrSensModFinal.INO int OBLED = 13; // Declares to the rest of the code that the onboard LED pin is going to be used int IrSensor = A0; // Declares to the rest of the code that Sensor output is connected to Adruino pin A0 int dwell = 55; // Causes the program to hold on to the current step (delay) befor moving on void setup () // This command sets up the Arduino software { // This bracket marks the start of set up pinMode (OBLED, OUTPUT); // Initializes Arduino pin 13 as an output and happens to be the same as the Arduino board's onboard LED digitalWrite (OBLED, HIGH); // Keeps the relay off while Arduino is initializing pinMode (IrSensor, INPUT_PULLUP); // Initializes analog pin "A0" as an input for the sensor module } // This bracket marks the end of set up void loop () // Runs the Arduino software in a never ending loop { // This bracket marks the start of the loop if (digitalRead (IrSensor) == LOW) // If a pinball is detected, do one of the following two things (May have to be set to "HIGH" depending on Ir module) { // This bracket marks the start of the "if" statement - The first thing digitalWrite (OBLED, HIGH); // If a pinball is detected, turn the onboard LED ON delay (dwell); // Keeps the output pin #13 (and the associated onboard LED) at a HIGH / ON state for the determined duration } // This bracket marks the end of the "if" statement else // If a pinball is not detected, keep the onboard LED OFF { // This bracket marks the start of the "else" statement - The second thing digitalWrite (OBLED, LOW); // This command keeps the onboard LED off } // This bracket marks the end of the "else" statement } // This bracket marks the end of the loopvoid setup()