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

API Description

Go to the source code of this file.

Data Structures

struct  _mq303a_context
 

Functions

mq303a_context mq303a_init (int pin, int heater_pin)
 
void mq303a_close (mq303a_context dev)
 
upm_result_t mq303a_get_value (mq303a_context dev, int *val)
 
upm_result_t mq303a_heater_enable (mq303a_context dev, bool enable)
 

Typedefs

typedef struct _mq303a_contextmq303a_context
 

Function Documentation

mq303a_context mq303a_init ( int  pin,
int  heater_pin 
)

MQ303A Initialization function

Parameters
pinAnalog pin to use
heaterPinDigital pin mapped to the analog pin to use
Returns
void* pointer to the sensor struct
void mq303a_close ( mq303a_context  dev)

MQ303A Initialization function

Parameters
void*pointer to the sensor struct
upm_result_t mq303a_get_value ( mq303a_context  dev,
int *  val 
)

This function gets the value of the alcohol content

Parameters
void*pointer to the sensor struct
*valpointer to store the reading
Returns
upm_result_t UPM success/error code
upm_result_t mq303a_heater_enable ( mq303a_context  dev,
bool  enable 
)

This function enables/disables the heater on board the sensor.

Parameters
void*pointer to the sensor struct
boolto turn on/off heater
Returns
upm_result_t UPM success/error code

Typedef Documentation

typedef struct _mq303a_context * mq303a_context

device context