upm
1.7.1
Sensor/Actuator repository for libmraa (v2.0.0)
|
Go to the source code of this file.
Data Structures | |
struct | _gp2y0a_context |
Functions | |
gp2y0a_context | gp2y0a_init (int pin, float a_ref) |
void | gp2y0a_close (gp2y0a_context dev) |
upm_result_t | gp2y0a_get_value (gp2y0a_context dev, float a_ref, uint8_t samples, float *val) |
Typedefs | |
typedef struct _gp2y0a_context * | gp2y0a_context |
gp2y0a_context gp2y0a_init | ( | int | pin, |
float | a_ref | ||
) |
GP2Y0A sensor init function
pin | Analog pin to use |
a_ref | reference voltage |
void gp2y0a_close | ( | gp2y0a_context | dev | ) |
GP2Y0A close function
dev | sensor struct |
upm_result_t gp2y0a_get_value | ( | gp2y0a_context | dev, |
float | a_ref, | ||
uint8_t | samples, | ||
float * | val | ||
) |
Gets an average voltage value from the sensor
dev | sensor struct |
aref | Reference voltage in use (usually 5.0V or 3.3V) |
samples | Number of samples to average over |
typedef struct _gp2y0a_context * gp2y0a_context |
device context