Noiasca Tool Kit
Several helper functions and classes to make life with Arduino easier
|
PCF8574 Expander Hardware class. More...
#include <Noiasca_PCF8574.h>
Public Member Functions | |
PCF8574expander (uint8_t i2cAddr) | |
PCF8574expander (TwoWire &i2cPort, uint8_t i2cAddr) | |
void | digitalWrite (uint8_t pin, uint8_t val) |
write to a pin More... | |
uint8_t | getPinStatus () |
read pin status More... | |
void | setPinStatus (uint8_t _pinStatus) |
set pin status More... | |
PCF8574 Expander Hardware class.
Takes Wire and I2C address and administrates the port. This connects the low level hardware. The class is needed becauses each pin on the PCF8574 should be treated seperately but the IC accepts only one byte for all 8 hardware pins
|
inline |
i2cAddr | the I2C address (0x20 - 0x27 or 0x38 - 0x3F) |
|
inline |
i2cAddr | the I2C address (0x20 - 0x27 or 0x38 - 0x3F) |
i2cPort | use Wire or any other TwoWire (I2C) interface you have available on your microcontroller |
|
inline |
write to a pin
set or unset an output pin.
pin | the pin to write |
val | the value LOW or HIGH |
|
inline |
read pin status
|
inline |
set pin status
This function only sets the internal variable - doesn't change pins
_pinStatus | the new value for the pin status |