pyupm_gp2y0a module

class pyupm_gp2y0a.GP2Y0A(pin)[source]

Bases: object

API for the GP2Y0A family of IR Proximity Sensors.

ID: gp2y0a

Name: Analog Infrared (IR) Based Distance Sensor

Other Names: Grove 80cm IR Proximity Sensor

Category: light

Manufacturer: seeed

Connection: analog

Link:http://wiki.seeed.cc/Grove-80cm_Infrared_Proximity_Sensor/ 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.

C++ includes: gp2y0a.hpp

value(aref, samples)[source]

float value(float aref, uint8_t samples)

Gets an average voltage value from the sensor

aref: Reference voltage in use (usually 5.0V or 3.3V)

samples: Number of samples to average over

Average voltage reading