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. 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, check license.txt for more information All text above must be included in any redistribution

Files at this revision

API Documentation at this revision

Comitter:
bxd
Date:
Sun Jan 05 22:29:21 2014 +0000
Parent:
3:5e1fd11c4f94
Commit message:
updated comment about addressing.

Changed in this revision

Adafruit_PWMServoDriver.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/Adafruit_PWMServoDriver.cpp	Sun Jan 05 22:26:12 2014 +0000
+++ b/Adafruit_PWMServoDriver.cpp	Sun Jan 05 22:29:21 2014 +0000
@@ -23,6 +23,8 @@
   _i2c = i2c;
  
   // Arduino WIRE library takes address as 7-bit (unshifted), mbed takes 8 bit.
+  // in other words, use the Adafruit library default value 0x40 to talk with the breakout
+  // if you use the default resistor config.
   _i2caddr = addr << 1;
 }
 
@@ -80,9 +82,9 @@
 uint8_t Adafruit_PWMServoDriver::read8(uint8_t addr) {
     char data;
     if(_i2c->write(_i2caddr, (char *)&addr, 1, true))
-        printf("no ack on write before read.\n");
+        printf("I2C ERR: no ack on write before read.\n");
     if(_i2c->read(_i2caddr, &data, 1))
-        printf("no ack on read\n");
+        printf("I2C ERR: no ack on read\n");
     return (uint8_t)data;
 }
 
@@ -90,6 +92,6 @@
     char data[] = { addr, d };
     if(_i2c->write(_i2caddr, data, 2))
     {    
-        printf("No ACK on i2c write!");
+        printf("I2C ERR: No ACK on i2c write!");
     }
 }
\ No newline at end of file