mraa  0.4.5
Low Level Skeleton Library for Communication on GNU/Linux platforms
 All Data Structures Namespaces Files Functions Variables 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 ()
 

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. Note this value can never be outside of the bounds of an unsigned short

Returns
The current input voltage, normalised to a 16-bit value

Here is the call graph for this function:


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