upm  1.7.1
Sensor/Actuator repository for libmraa (v2.0.0)
Public Member Functions | Protected Attributes
Gas Class Reference

Public Member Functions

 Gas (int gasPin)
 
virtual ~Gas ()
 
virtual int getSampledWindow (unsigned int freqMS, int numberOfSamples, uint16_t *buffer)
 
virtual int findThreshold (thresholdContext *ctx, unsigned int threshold, uint16_t *buffer, int len)
 
virtual int getSampledData (thresholdContext *ctx)
 
virtual int getSample ()
 
virtual void printGraph (thresholdContext *ctx, uint8_t resolution)
 

Protected Attributes

mraa::Aio m_aio
 

Constructor & Destructor Documentation

Gas ( int  gasPin)

Instantiates a Gas object

Parameters
gasPinPin where gas is connected
~Gas ( )
virtual

Gas object destructor

Member Function Documentation

int getSampledWindow ( unsigned int  freqMS,
int  numberOfSamples,
uint16_t *  buffer 
)
virtual

Gets samples from the gas sensor according to the provided window and number of samples

Parameters
freqMSTime between each sample (in milliseconds)
numberOfSamplesNumber of sample to sample for this window
bufferBuffer with sampled data

Here is the call graph for this function:

int findThreshold ( thresholdContext ctx,
unsigned int  threshold,
uint16_t *  buffer,
int  len 
)
virtual

Given the sampled buffer, this method returns TRUE/FALSE if the threshold is reached

Parameters
ctxThreshold context
thresholdSample threshold
bufferBuffer with samples
lenBuffer length
int getSampledData ( thresholdContext ctx)
virtual

Returns average data for the sampled window

Parameters
ctxThreshold context
int getSample ( )
virtual

Returns one sample from the sensor

Here is the caller graph for this function:

void printGraph ( thresholdContext ctx,
uint8_t  resolution 
)
virtual

Prints a running average of the threshold context

Parameters
ctxThreshold context
Inheritance diagram for Gas:
Inheritance graph
[legend]

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