mraa  0.6.0
Low Level Skeleton Library for Communication on GNU/Linux platforms
 All Data Structures Namespaces Files Functions Typedefs Enumerations Enumerator Pages
Public Member Functions
Aio Class Reference

Detailed Description

This file defines the aio interface for libmraa

#include "mraa.hpp"
int main ()
{
uint16_t adc_value;
mraa::Aio* a0;
a0 = new mraa::Aio(0);
if (a0 == NULL) {
}
for(;;) {
adc_value = a0->read();
fprintf(stdout, "ADC A0 read %X - %d\n", adc_value, adc_value);
}
return MRAA_SUCCESS;
}

Public Member Functions

 Aio (unsigned int pin)
 
 ~Aio ()
 
int read ()
 
mraa_result_t setBit (int bits)
 
int getBit ()
 

Constructor & Destructor Documentation

Aio ( unsigned int  pin)
inline

Aio Constructor, takes a pin number which will map directly to the board number

Parameters
pinchannel number to read ADC inputs

Here is the call graph for this function:

~Aio ( )
inline

Aio destructor

Here is the call graph for this function:

Member Function Documentation

int read ( )
inline

Read a value from the AIO pin. By default mraa will shift the raw value up or down to a 10 bit value.

Returns
The current input voltage. By default, a 10bit value

Here is the call graph for this function:

mraa_result_t setBit ( int  bits)
inline

Set the bit value which mraa will shift the raw reading from the ADC to. I.e. 10bits

Parameters
bitsthe bits the return from read should be i.e 10
Returns
mraa result type

Here is the call graph for this function:

int getBit ( )
inline

Gets the bit value mraa is shifting the analog read to.

Returns
bit value mraa is set return from the read function

Here is the call graph for this function:


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