Skip to content

Commit 892de54

Browse files
authored
Merge pull request #69 from photodude/patch-1
Correct Servo frequency to 50 Hz
2 parents 6552bd0 + 155284d commit 892de54

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

examples/servo/servo.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver();
3535
#define SERVOMAX 600 // This is the 'maximum' pulse length count (out of 4096)
3636
#define USMIN 600 // This is the rounded 'minimum' microsecond length based on the minimum pulse of 150
3737
#define USMAX 2400 // This is the rounded 'maximum' microsecond length based on the maximum pulse of 600
38-
#define SERVO_FREQ 60 // Analog servos run at ~60 Hz updates
38+
#define SERVO_FREQ 50 // Analog servos run at ~50 Hz updates
3939

4040
// our servo # counter
4141
uint8_t servonum = 0;
@@ -49,7 +49,7 @@ void setup() {
4949
// that precise. You can 'calibrate' by tweaking this number till
5050
// you get the frequency you're expecting!
5151
pwm.setOscillatorFrequency(27000000); // The int.osc. is closer to 27MHz
52-
pwm.setPWMFreq(SERVO_FREQ); // Analog servos run at ~60 Hz updates
52+
pwm.setPWMFreq(SERVO_FREQ); // Analog servos run at ~50 Hz updates
5353

5454
delay(10);
5555
}
@@ -99,4 +99,4 @@ void loop() {
9999

100100
servonum++;
101101
if (servonum > 7) servonum = 0; // Testing the first 8 servo channels
102-
}
102+
}

0 commit comments

Comments
 (0)