I need help with the Ping (ultra sonic node)

How do I tell how far some thing is away from the ultra sonic sensor? To tell when the pump should turn on to full the cup? (I am VERRY new to XOD so sorry if this is a silly Question)

There is example code under xod-dev/hc-sr04 if your sensor is compatible with that.