UPM

The UPM API is a high level sensor library for IoT devices using MRAA. See examples here. Back to index page.
SparkFun sensor images provided under CC BY-NC-SA-3.0.

MAXSONAREZ Class

Module: maxsonarez
  • ID: maxsonarez
  • Name: LV-MaxSonar-EZ Ultrasonic Ranger
  • Other Names: EZ1, EZ2, EZ3, EZ4
  • Category: sound
  • Manufacturer: sparkfun
  • Link: https://www.sparkfun.com/products/8502
  • Connection: analog

Sensors of this family return an analog voltage corresponding to the distance of an object from the sensor in inches. They have a resolution of about 9.7 millivolts per inch with an analog reference voltage of 5.0 V. The differences between various versions (EZ1, EZ2, etc.) are related to the narrowness of the beam angle.
This class supports these sensors with an analog input only.
This driver was developed using an LV-MaxSonar-EZ3 ultrasonic ranger.
maxsonarez.jpg

Item Index

Methods

Methods

MAXSONAREZ

(
  • pin
  • aref
)
Number

MAXSONAREZ constructor

Parameters:

  • pin Number

    Analog pin to use

  • aref Number

    Analog reference voltage; default is 5.0 V

Returns:

Number:

inches

() Number

Gets the distance to the object in inches

Returns:

Number:

Distance to the object in inches