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
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 channel ADC channel of the PCF8591 char deviceAddress the address of the PCF8591
Definition at line 232 of file PCF8591.cpp.
Member Function Documentation
void _init | ( | ) | [protected] |
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 | ( | ) |
Generated on Tue Jul 12 2022 17:26:42 by 1.7.2