PCA9635 16-bit I2C-bus LED driver

Dependents:   digitalThermometer Counter SimpleClock printNumber ... more

Revision:
9:48985b738e5a
Parent:
7:5c10a0ccc663
Child:
10:b807470a8b09
--- a/PCA9635.cpp	Wed Jun 29 08:45:40 2011 +0000
+++ b/PCA9635.cpp	Wed Jun 29 13:39:28 2011 +0000
@@ -82,6 +82,21 @@
         temp = (temp >> 1);     //bitwise shift right by 1 to scan next bit
     }
 }
+void PCA9635::bus(short leds, int address)
+{
+    setAddress(address);
+    
+    short temp = leds;          //check each bit of leds
+    for(int j=0; j<16; j++) {
+        if(temp & 1){       //set output according to LSB
+            on(j);                
+        }
+        else {
+            off(j);
+        }
+        temp = (temp >> 1);     //bitwise shift right by 1 to scan next bit
+    }
+}
 
 //Brightness control for single or all LEDs
 void PCA9635::brightness(char led, char value)