Qwiic GPIO & pulseIn()

Hi folks,

I just received a couple of [Qwiic GPIO boards and I’ve gotta say these guys are pretty darn handy!

I’m currently trying to get the Qwiic GPIO working with a MaxBotix ultrasonic sensor, similar to the one SparkFun sells (https://www.sparkfun.com/products/15798). I am attempting to use pulse width measurements and would appreciate if anyone has any insights on whether this should be possible.

I realize as a SparkX product we’re kind of in the wild west with there being no library. I’ve been trying to wrap my head around the GitHub examples but I find that they’re not super intuitive.

The most simple way to obtain a pulse width measrement of distance from the MaxBotix sensor is with the following function:

void read_sensor(){
  sensor1 = pulseIn(pwPin1, HIGH);
  cm = sensor1/10; // converts the range to cm
  inches = cm/2.54; // converts the range to inches
}

The question is: can the Qwiic GPIO be used with pulseIn()?

Cheers,

Adam](SparkFun Qwiic GPIO - DEV-17047 - SparkFun Electronics)