I am using a MatBotix Sensor and want to use the single pin.  I am going crazy trying to ping it and get the time elasped, much like the UltraSonicSensor.  I did the PIRs without using the PIR Service and attached a PinArrayListener and get my passive reads no problem.  I can rewire that matbotix, although I have dug all the way down to and and and just want to find a way to perform the PulseIn() feature of Arduino.  Hit the pin with a 1, and then read the pin for the 0, and calculate the MS.  I cannot seem to easily get at those Milliseconds. 

I tried with 1 pin, but as you know that causes a serial read error as they are both accessing the same address.  I tried a dummy pin, but then I do not get the read.  A trigger does not return the delay in MS.  There must be an easy way that I am just missing.  Please Help!


Gareth's picture

What about Analogue Pin output

Watcha Jim,

Which MatBotix Sensor do you have ?

On my MatBotix Sensor I have also an "AN" pin which can be used instead of the PWM/BW timeing pins.

Basically it gives an analog out in relation to distance.

It might be a quick workaround to simply read it in as an analog ... analog>distance formulas can be found here depending on your device :-