Skip to content

Commit

Permalink
Merge pull request #97 from caternuson/setosc
Browse files Browse the repository at this point in the history
Move setOscillatorFrequency() call in begin()
  • Loading branch information
ladyada authored Aug 10, 2023
2 parents 032e425 + 761bc1b commit 0e664c6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Adafruit_PWMServoDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,16 @@ bool Adafruit_PWMServoDriver::begin(uint8_t prescale) {
if (!i2c_dev->begin())
return false;
reset();

// set the default internal frequency
setOscillatorFrequency(FREQUENCY_OSCILLATOR);

if (prescale) {
setExtClk(prescale);
} else {
// set a default frequency
setPWMFreq(1000);
}
// set the default internal frequency
setOscillatorFrequency(FREQUENCY_OSCILLATOR);

return true;
}
Expand Down

0 comments on commit 0e664c6

Please sign in to comment.