Library for NXP (Philips) PCF8591 I2C 4 Channel, 8bit Analog to Digital converter and a 1 Channel, 8bit Digital to Analog converter.

Dependents:   812_hello PCF8591_test_LAAS

Embed: (wiki syntax)

« Back to documentation index

PCF8591_AnalogIn Class Reference

PCF8591_AnalogIn Class Reference

Create a PCF8591 AnalogIn object connected to the specified I2C bus and deviceAddress. More...

#include <PCF8591.h>

Public Member Functions

 PCF8591_AnalogIn (I2C *i2c, uint8_t channel, uint8_t deviceAddress=PCF8591_SA0)
 Create a PCF8591 AnalogIn object using a specified I2C bus and slaveaddress.
float read ()
 Read Analog input.
 operator float ()
 An operator shorthand for read()

Protected Member Functions

void _init ()
 Initialise DAC driver.

Detailed Description

Create a PCF8591 AnalogIn object connected to the specified I2C bus and deviceAddress.

Definition at line 191 of file PCF8591.h.


Constructor & Destructor Documentation

PCF8591_AnalogIn ( I2C *  i2c,
uint8_t  channel,
uint8_t  deviceAddress = PCF8591_SA0 
)

Create a PCF8591 AnalogIn object using a specified I2C bus and slaveaddress.

Create a PCF8591 AnalogIn object connected to the specified I2C bus and deviceAddress.

Parameters:
I2C&i2c the I2C port to connect to
channelADC channel of the PCF8591
chardeviceAddress the address of the PCF8591

Definition at line 232 of file PCF8591.cpp.


Member Function Documentation

void _init (  ) [protected]

Initialise DAC driver.

Initialise ADC driver.

Definition at line 282 of file PCF8591.cpp.

operator float (  )

An operator shorthand for read()

Operator float Analog Input.

Returns:
analogIn value (0 .. 1.0)

Definition at line 274 of file PCF8591.cpp.

float read (  )

Read Analog input.

Returns:
analogIn value (0 .. 1.0)

Definition at line 244 of file PCF8591.cpp.