This is a library for the PCA9685 ported from the Adafruit Ardiuno library.

Revision:
2:ec40a85eba51
Parent:
0:1ecf26e0cf3c
diff -r f1b17f9d387e -r ec40a85eba51 PCA9685Lib.cpp
--- a/PCA9685Lib.cpp	Fri Feb 13 23:26:00 2015 +0000
+++ b/PCA9685Lib.cpp	Sat Feb 14 19:35:08 2015 +0000
@@ -1,25 +1,4 @@
-/*
-  This is a library for our Adafruit 16-channel PWM & Servo driver
 
-  Pick one up today in the adafruit shop!
-  ------> http://www.adafruit.com/products/815
-
-  These displays use I2C to communicate, 2 pins are required to
-  interface. For Arduino UNOs, thats SCL -> Analog 5, SDA -> Analog 4
-
-  Adafruit invests time and resources providing this open source code,
-  please support Adafruit and open-source hardware by purchasing
-  products from Adafruit!
-
-  Written by Limor Fried/Ladyada for Adafruit Industries.
-  BSD license, all text above must be included in any redistribution
- ****************************************************/
-
- /*****************************
-  This program was ported from https://github.com/adafruit/Adafruit-PWM-Servo-Driver-Library.
-  I also added some functions.
-  Shundo Kishi
- */
 
 #include "PCA9685Lib.h"
 
@@ -87,6 +66,11 @@
     setPrescale(prescale);
 }
 
+void PCA9685Lib::setMode2(uint8_t val)
+{
+    write8(PCA9685_MODE2, val);
+}
+
 void PCA9685Lib::setPWM(uint8_t num, uint16_t on, uint16_t off) {
     // hmm doesnt work, whyso?  (  Not in AI mode.  See line 54 above.  ( Works now!!  :D  )
 
@@ -126,3 +110,24 @@
 }
 
 
+/*
+  This is a library for our Adafruit 16-channel PWM & Servo driver
+
+  Pick one up today in the adafruit shop!
+  ------> http://www.adafruit.com/products/815
+
+  These displays use I2C to communicate, 2 pins are required to
+  interface. For Arduino UNOs, thats SCL -> Analog 5, SDA -> Analog 4
+
+  Adafruit invests time and resources providing this open source code,
+  please support Adafruit and open-source hardware by purchasing
+  products from Adafruit!
+
+  Written by Limor Fried/Ladyada for Adafruit Industries.
+  BSD license, all text above must be included in any redistribution
+ ****************************************************/
+
+ /*****************************
+  This program was ported from https://github.com/adafruit/Adafruit-PWM-Servo-Driver-Library.
+
+ */
\ No newline at end of file