upm  1.7.1
Sensor/Actuator repository for libmraa (v2.0.0)
Data Structures | Functions | Macros | Typedefs
Include dependency graph for rotary.h:

API Description

Go to the source code of this file.

Data Structures

struct  _rotary_context
 

Functions

rotary_context rotary_init (int pin, float aRef)
 
void rotary_close (rotary_context dev)
 
upm_result_t rotary_get_value_voltage (const rotary_context dev, float *volts)
 
upm_result_t rotary_get_value_angle (rotary_context dev, float *rotval)
 

Macros

#define ROTARY_MAX_ANGLE   300
 

Typedefs

typedef struct _rotary_contextrotary_context
 

Function Documentation

rotary_context rotary_init ( int  pin,
float  aRef 
)

Rotary angle sensor initialization function

Parameters
pinanalog pin to use
aRefreference voltage
Returns
sensor context
void rotary_close ( rotary_context  dev)

Rotary destructor

Parameters
devsensor context pointer
upm_result_t rotary_get_value_voltage ( const rotary_context  dev,
float *  volts 
)

Gets the voltage value from the analog pin

Parameters
devsensor context pointer
voltssensor voltage value
Returns
result of the operation
upm_result_t rotary_get_value_angle ( rotary_context  dev,
float *  rotval 
)

Gets the position of the rotary angle sensor in degrees

Parameters
devsensor context pointer
rotvalsensor position in degrees
Returns
result of the operation

Typedef Documentation

typedef struct _rotary_context * rotary_context

driver context