adafruit / Adafruit-PWM-Servo-Driver-Library

Adafruit PWM Servo Driver Library
Other
477 stars 311 forks source link

_oscillator_freq not initialized? #78

Closed gitcob closed 1 year ago

gitcob commented 4 years ago

_oscillator_freq is a member variable but it's not initialized in the constructor. If I understand correctly, begin(0) would then call setPWMFreq which uses that variable, and only after that it is set to the default value.

Calling setOscillatorFrequency before would probably defeat the purpose too, since it would be overwritten with the default.

caternuson commented 1 year ago

Correct. It will be set after the call to begin(). In general, begin() should be the first thing called.