PCA9555
Dependents: Telliskivi2_2014 PowerManagementBoard_Rev_A_2017
Diff: PCA9555.cpp
- Revision:
- 5:73884f49ed97
- Parent:
- 3:bcda053645e2
- Child:
- 7:3b54389686ca
diff -r bcda053645e2 -r 73884f49ed97 PCA9555.cpp --- a/PCA9555.cpp Sat Sep 14 17:19:41 2013 +0000 +++ b/PCA9555.cpp Mon Sep 16 16:09:56 2013 +0000 @@ -29,32 +29,36 @@ } void PCA9555::write(int data) { - /*char foo[3]; + char foo[3]; foo[0]=0x02; foo[1]=data; foo[2]=data>>8; - _i2c.write(_address, foo, 3);*/ - char foo[2]; + _i2c.write(_address, foo, 3); + /*char foo[2]; foo[0]=0x02; foo[1]=data; _i2c.write(_address, foo, 2); foo[0]=0x03; foo[1]=data>>8; - _i2c.write(_address, foo, 2); + _i2c.write(_address, foo, 2);*/ } void PCA9555::setPin(unsigned int pinNumber) { currentWriteState |= ((unsigned int)1 << pinNumber); - write(currentWriteState); + //write(currentWriteState); } void PCA9555::clearPin(unsigned int pinNumber) { currentWriteState &= ~((unsigned int)1 << pinNumber); - write(currentWriteState); + //write(currentWriteState); } void PCA9555::togglePin(unsigned int pinNumber) { currentWriteState ^= ((unsigned int)1 << pinNumber); + //write(currentWriteState); +} + +void PCA9555::writePins() { write(currentWriteState); }