Adafruit PWM library not working after update

Hi all.
I am after some help after updating my Arduino IDE to 2.3.2 a couple of hours ago.
I am using the Adafruit libraries as I am trying to learn to control bulk servos.
Last week (before the update) this was working fine with the only issues being my inept coding after 20+years.
Now I am constantly getting the following error


I have updated all the libraries and re downloaded the Adafruit library from the libraries manager.
I have resorted to using the default examples that are supplied with the library (PWM test) but all of them present with the same error.
My board is a MEGA 2560 and yes I have selected the correct board and com port (that was the first error I solved) This was working last week with these examples.
any suggestions would be appreciated.

Here is the code I am using directly from the examples folder

/*************************************************** 
  This is an example for our Adafruit 16-channel PWM & Servo driver
  PWM test - this will drive 16 PWMs in a 'wave'

  Pick one up today in the adafruit shop!
  ------> http://www.adafruit.com/products/815

  These drivers 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, all text above must be included in any redistribution
 ****************************************************/

#include <Wire.h>
#include <Adafruit_PWMServoDriver.h>

// called this way, it uses the default address 0x40
Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver();
// you can also call it with a different address you want
//Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver(0x41);
// you can also call it with a different address and I2C interface
//Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver(0x40, Wire);

void setup() {
  Serial.begin(9600);
  Serial.println("16 channel PWM test!");

  pwm.begin();
  /*
   * In theory the internal oscillator (clock) is 25MHz but it really isn't
   * that precise. You can 'calibrate' this by tweaking this number until
   * you get the PWM update frequency you're expecting!
   * The int.osc. for the PCA9685 chip is a range between about 23-27MHz and
   * is used for calculating things like writeMicroseconds()
   * Analog servos run at ~50 Hz updates, It is importaint to use an
   * oscilloscope in setting the int.osc frequency for the I2C PCA9685 chip.
   * 1) Attach the oscilloscope to one of the PWM signal pins and ground on
   *    the I2C PCA9685 chip you are setting the value for.
   * 2) Adjust setOscillatorFrequency() until the PWM update frequency is the
   *    expected value (50Hz for most ESCs)
   * Setting the value here is specific to each individual I2C PCA9685 chip and
   * affects the calculations for the PWM update frequency. 
   * Failure to correctly set the int.osc value will cause unexpected PWM results
   */
  pwm.setOscillatorFrequency(27000000);
  pwm.setPWMFreq(1600);  // This is the maximum PWM frequency

  // if you want to really speed stuff up, you can go into 'fast 400khz I2C' mode
  // some i2c devices dont like this so much so if you're sharing the bus, watch
  // out for this!
  Wire.setClock(400000);
}

void loop() {
  // Drive each PWM in a 'wave'
  for (uint16_t i=0; i<4096; i += 8) {
    for (uint8_t pwmnum=0; pwmnum < 16; pwmnum++) {
      pwm.setPWM(pwmnum, 0, (i + (4096/16)*pwmnum) % 4096 );
    }
#ifdef ESP8266
    yield();  // take a breather, required for ESP8266
#endif
  }
}

I can not help you about the "why" of your problem. From which version did you update?

Did you check C:\Users\Steve\Arduino\libraries for the presence of the Adafruit_I2C device library? If it does not exist, install it. Adafruit libraries often have dependencies on other Adafruit libraries and it's possible that you ignored the information about the dependencies.

"Last week" you might have been using an older version of the Adafruit_PWMServoDriver which did not have the dependency, I do not know.

Thanks, had a look and it wasn't there. tried reinstalling the Adafruit PWM library and dependencies. I got an error saying it failed to install so I deleted the adafruit library and reinstalled and it is working.

Great !

Next time, please remember that

  1. screenshots of errors (or code for that matter) are considered useless; copy and paste them here using code tags. I'm not complaining but it took me a while to type the path in my previous post :wink:
  2. " failed to install" does not say much without context; I'm reasonably sure that the output window provides more information about the error.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.