PCF8574 I2C IO Expander

This is an I2C 8 bit IO expander, which you can add up to 8 of to a single I2C bus.

Commonly used for interfacing to Mindstorms :

Hardware

source:/PCF8574/doc/PCF8574Interface.png source:/PCF8574/doc/PCF8574Product.jpg

Software

Right-click the project to import to, select "Import Library..." and use the following details:

PCF8574Abstraction for the popular I2C 8 Bit IO expander
Functions
PCF8574Create an instance of the PCF8574 connected to specfied I2C pins, with the specified address.
readRead the IO pin level
writeWrite the IO pin levels
PCF8574 (PinName sda,
PinName scl,
int addr)
Create an instance of the PCF8574 connected to specfied I2C pins, with the specified address.
int read (void)
Read the IO pin level
void write (int data)
Write the IO pin levels

View the library

Hello World!

source:/PCF8574/doc/PCF8574Schematic.png source:/PCF8574/doc/PCF8574Product.jpg
Schematic Photo
#include "mbed.h"
#include "PCF8574.h"

PCF8574 io(p9,p10,0x20);
int main(){
    // Spin in a loop toggling the PCF8574pins
    while(1) {
        io.write(0x0);
        wait(0.2);
        io.write(0xf);
        wait(0.2);
    }
 }
LPC1768_PCF8574.bin
LPC2368_PCF8574.bin
Source Code Binary

Resources

Datasheet