Explorer hat Pro Coding for non analogue input

The function reference is here,

Input
Explorer HAT/pHAT includes 4 buffered, 5v tolerant inputs. These act just like the GPIO pins on your Pi and don't require any special treatment. When you send a HIGH signal into them, you'll read a HIGH pin state ( 1 ) in Python.
read() - Read the state of the input
has_changed() - Returns true if the input has changed since the last read
on_changed( handler_function[, bounce_time ] ) - Calls "handler_function" when the input changes, debounce time ( in ms ) is optional
on_low( handler_function[, bounce_time ] ) - Calls "handler_function" when the input goes low ( off )
on_high( handler_function[, bounce_time ] ) - Calls "handler_function" when the input goes on ( high )
clear_events() - Remove all handlers
Unlike analog events, you'll get an instance of the input passed to your handler function, so you can do something like this:
def changed(input):
  state = input.read()
  name  = input.name
  print("Input {} changed to {}".format(name,state))
  
explorerhat.input.one.changed(changed)
Then, when you change the input you'll see something like:
Input one changed to 1
Input one changed to 0

And from the link you posted

microDelay( 210);                   // Wait 210µs (8 pulses of 38kHz).
if( digitalRead( outputPin))        // If detector Output is HIGH,
{
    objectDetect = false;           // then no object was detected;
}
else                                // but if the Output is LOW,
{
    microDelay( 395);               // wait for another 15 pulses.
    if( digitalRead( outputPin))    // If the Output is now HIGH,
    {                               // then first Read was noise
        objectDetect = false;       // and no object was detected;
    }
    else                            // but if the Output is still LOW,
    {
        objectDetect = true;        // then an object was truly detected.
    }
}
digitalWrite( enablePin, LOW);      // Disable the internal 38kHz signal.

You’ll want to wire the VCC to 3.3V, and GND to Ground.
Then wire the EN (Enable) to an Output pin on the Explorer Hat, and the OUT pin to an Input on the Hat. Then do what is listed in that sample C code. The comment part gives you the time to turn on off etc. The Output function reference is just below the Input function reference.