This program is for writing to PCA9532 on the LPCXpresso Base Board.

Dependencies:   mbed

PCA9532.cpp

Committer:
Lerche
Date:
2010-02-06
Revision:
0:8dffae878f54

File content as of revision 0:8dffae878f54:

#include "PCA9532.h"
#include "mbed.h"
using namespace mbed;
PCA9532::PCA9532(PinName sda, PinName scl, int addr)
    : _i2c(sda,scl) {
    _addr = addr;
    }   

int PCA9532::read(void) {
    char foo[1];
    _i2c.read(_addr,foo,1); 
    return (foo[0]);
 }

void PCA9532::write(int command, int data) {
    char foo[2];
    foo[0] = command;
    foo[1] = data;
    _i2c.write(_addr,foo,2);
    return;
 }