Skip to content

Commit 95495c1

Browse files
committed
bugfix: defaultPos
1 parent c313cb8 commit 95495c1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Servo_Hardware_PWM.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ uint8_t Servo::attach(int pin, int min, int max) {
3838
uint8_t Servo::attach(int pin, int min, int max, int defaultPos) {
3939
this->min = min;
4040
this->max = max;
41-
this->defaultPos = defaultPos;
41+
this->defaultPos = defaultPos * 2;
4242

4343
if (this->servoIndex < MAX_SERVOS)
4444
{

src/Servo_Hardware_PWM.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575

7676
#define MIN_PULSE_WIDTH 500 //the shortest pulse sent to a servo
7777
#define MAX_PULSE_WIDTH 2500 //the longest pulse sent to a servo
78-
#define DEFAULT_PULSE_WIDTH 0 //default pulse width when servo is attached
78+
#define DEFAULT_PULSE_WIDTH 1500 //default pulse width when servo is attached
7979
#define MAX_TIMER_COUNT 40000 //the timer TOP value (for creating 50Hz)
8080

8181
#define MAX_SERVOS 6 //6 Servos can be attached

0 commit comments

Comments
 (0)