final_8조 / Mbed OS Line-Tracking

Dependencies:   WS2812 PixelArray Adafruit_GFX

Embed: (wiki syntax)

« Back to documentation index

PCF8574 Class Reference

PCF8574 Class Reference

Interface to the popular PCF8574 I2C 8 Bit IO expander. More...

#include <PCF8574.h>

Public Member Functions

 PCF8574 (PinName sda, PinName scl, int address)
 Create an instance of the PCF8574 connected to specfied I2C pins, with the specified address.
int read ()
 Read the IO pin level.
void write (int data)
 Write to the IO pins.

Detailed Description

Interface to the popular PCF8574 I2C 8 Bit IO expander.

Definition at line 7 of file PCF8574.h.


Constructor & Destructor Documentation

PCF8574 ( PinName  sda,
PinName  scl,
int  address 
)

Create an instance of the PCF8574 connected to specfied I2C pins, with the specified address.

Parameters:
sdaThe I2C data pin
sclThe I2C clock pin
addressThe I2C address for this PCF8574

Definition at line 4 of file PCF8574.cpp.


Member Function Documentation

int read (  )

Read the IO pin level.

Returns:
The byte read

Definition at line 10 of file PCF8574.cpp.

void write ( int  data )

Write to the IO pins.

Parameters:
dataThe 8 bits to write to the IO port

Definition at line 16 of file PCF8574.cpp.