Tessel driver for the Grove Ultrasonic Ranger v1.0 (SEN10737P).
Using the package is easy. Just download and install it via NPM.
npm install tessel-sen10737p --save
Once the package is downloaded and installed, you need to get a reference to a pin on the Tessel that supports reading a PWM pulse. The driver has been tested using the G3 pin on the GPIO port.
// Load modules.var tessel = ;var sen10737p = ;// Select a pin that supports reading a PWM pulse.var gpio = tesselport'GPIO';var pin = gpiopin'G3';// Get a ranger which is bound to the PWM capable pin.var ranger = sen10737p;// Call getDistance passing in a callbackranger;};
According to the Seeed Studio wiki, the SEN10737P supports both 3.3V and 5V power source. This means that you can wire-up the sensor directly to the Tessel assuming you are running it from the 3.3V power source. However if you are running from a 5V source you will need to step down the voltage.
If you find a bug feel free to fork the code and submit a pull request.