MRAA

MRAA is a low level skeleton library for communication on GNU/Linux platforms. See examples here.

Aio Class

Module: mraa

This file defines the aio interface for libmraa

Item Index

Methods

Aio

(
  • pin
)
Number

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

Parameters:

  • pin Number

    channel number to read ADC inputs

Returns:

Number:

read

() Number

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

Returns:

Number:

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

readFloat

() Number

Read a value from the AIO pin and return it as a normalized float.

Returns:

Number:

The current input voltage as a normalized float (0.0f-1.0f)

setBit

(
  • bits
)
Enum Result

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

Parameters:

  • bits Number

    the bits the return from read should be i.e 10

Returns:

Enum Result:

mraa::Result type

getBit

() Number

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

Returns:

Number:

bit value mraa is set return from the read function