PCA9635 16-bit I2C-bus LED driver

Dependents:   digitalThermometer Counter SimpleClock printNumber ... more

Revision:
2:9ca6a4fbab5e
Parent:
1:0a254eb888f1
Child:
3:0f4d95a27e26
--- a/PCA9635.h	Tue Jun 28 10:19:23 2011 +0000
+++ b/PCA9635.h	Tue Jun 28 12:32:18 2011 +0000
@@ -18,12 +18,13 @@
 * #include "PCA9635.h"
 * 
 * DigitalOut enable(p26);
-* PCA9635 my_driver(p28, p27, 0x02);
+* PCA9635 my_driver(p28, p27);
 * 
 * int main()
 * {
 *     enable = 0;
-*     
+*     my_driver.init(0x02);
+*     //N.B. you MUST declare init(int address), before calling any PCA9635 functions
 *     //turns each pin on and then off
 *
 *     short op = 1;
@@ -59,9 +60,8 @@
     *
     * @param sda Defines serial data line
     * @param scl Defines serial clock line
-    * @param addr chip address
     */
-        PCA9635(PinName sda, PinName scl, int addr);
+        PCA9635(PinName sda, PinName scl);
         
         char cmd[2];
         
@@ -94,9 +94,11 @@
         /** Reset chip 
         */
         void reset(void);
-        /** Initialise chip
+        /** Initialise chip - MUST call this before calling any other functions
+        *
+        * @param address hardware address
         */
-        void init(void);
+        void init(int address);
         
               
     private: