Skip to content

Commit ded0d04

Browse files
committed
add setosc example
1 parent d1f63cc commit ded0d04

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

examples/pwmtest/pwmtest.ino

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ void setup() {
3131
Serial.println("16 channel PWM test!");
3232

3333
pwm.begin();
34+
// In theory the internal oscillator is 25MHz but it really isn't
35+
// that precise. You can 'calibrate' by tweaking this number till
36+
// you get the frequency you're expecting!
37+
pwm.setOscillatorFrequency(27000000); // The int.osc. is closer to 27MHz
3438
pwm.setPWMFreq(1600); // This is the maximum PWM frequency
3539

3640
// if you want to really speed stuff up, you can go into 'fast 400khz I2C' mode

0 commit comments

Comments
 (0)