upm  0.4.1
Sensor/Actuator repository for libmraa (v0.8.0)
Public Member Functions | List of all members

API for the GP2Y0A family of IR Proximity Sensors. More...

Detailed Description

Sensors of this family return an analog voltage corresponding to the distance of an object from the sensor. The voltage is lower when objects are far away; the voltage increases as objects get closer to the sensor.

gp2y0a.jpg

Public Member Functions

synchronized void delete ()
 
 GP2Y0A (int pin)
 
float value (float aref, short samples)
 

Constructor & Destructor Documentation

GP2Y0A ( int  pin)

GP2Y0A sensor constructor

Parameters
pinAnalog pin to use

Member Function Documentation

float value ( float  aref,
short  samples 
)

Gets an average voltage value from the sensor

Parameters
arefReference voltage in use (usually 5.0V or 3.3V)
samplesNumber of samples to average over
Returns
Average voltage reading

The documentation for this class was generated from the following file: