Skip to content

Commit 4e76d5c

Browse files
committed
renamed "default" to "defaultPos"
1 parent 80011eb commit 4e76d5c

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/Servo_Hardware_PWM.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ uint8_t Servo::attach(int pin, int min, int max)
3737
return this->attach(pin, min, max, DEFAULT_PULSE_WIDTH);
3838
}
3939

40-
uint8_t Servo::attach(int pin, int min, int max, int default)
40+
uint8_t Servo::attach(int pin, int min, int max, int defaultPos)
4141
{
4242
this->min = min;
4343
this->max = max;
44-
this->default = default;
44+
this->defaultPos = defaultPos;
4545

4646
if (this->servoIndex < MAX_SERVOS) {
4747
if (pin == 2) {
@@ -64,7 +64,7 @@ uint8_t Servo::attach(int pin, int min, int max, int default)
6464
//setting the output to non inverted:
6565
TCCR3A |= (1 << COM3B1);
6666

67-
OCR3B = this->default; //setting the pulse width
67+
OCR3B = this->defaultPos; //setting the pulse width
6868

6969
//OC3B, Port E, Bit 4; setting pin 2 as output:
7070
DDRE |= (1 << PE4); //bit 4 (pin 2) as output
@@ -92,7 +92,7 @@ uint8_t Servo::attach(int pin, int min, int max, int default)
9292
//setting the output to non inverted:
9393
TCCR3A |= (1 << COM3C1);
9494

95-
OCR3C = this->default; //setting the pulse width
95+
OCR3C = this->defaultPos; //setting the pulse width
9696

9797
//OC3C, Port E, Bit 5; setting pin 3 as output:
9898
DDRE |= (1 << PE5); //bit 5 (pin 3) as output
@@ -120,7 +120,7 @@ uint8_t Servo::attach(int pin, int min, int max, int default)
120120
//setting the output to non inverted:
121121
TCCR4A |= (1 << COM4B1);
122122

123-
OCR4B = this->default; //setting the pulse width
123+
OCR4B = this->defaultPos; //setting the pulse width
124124

125125
//OC4B, Port H, Bit 4; setting pin 7 as output:
126126
DDRH |= (1 << PH4); //bit 4 (pin 7) as output
@@ -148,7 +148,7 @@ uint8_t Servo::attach(int pin, int min, int max, int default)
148148
//setting the output to non inverted:
149149
TCCR4A |= (1 << COM4C1);
150150

151-
OCR4C = this->default; //setting the pulse width
151+
OCR4C = this->defaultPos; //setting the pulse width
152152

153153
//OC4C, Port H, Bit 5; setting pin 8 as output:
154154
DDRH |= (1 << PH5); //bit 5 (pin 8) as output
@@ -176,7 +176,7 @@ uint8_t Servo::attach(int pin, int min, int max, int default)
176176
//setting the output to non inverted:
177177
TCCR5A |= (1 << COM5C1);
178178

179-
OCR5C = this->default; //setting the pulse width
179+
OCR5C = this->defaultPos; //setting the pulse width
180180

181181
//OC5C, Port L, Bit 5; setting pin 44 as output:
182182
DDRL |= (1 << PL5); //bit 5 (pin 44) as output
@@ -204,7 +204,7 @@ uint8_t Servo::attach(int pin, int min, int max, int default)
204204
//setting the output to non inverted:
205205
TCCR5A |= (1 << COM5B1);
206206

207-
OCR5B = this->default; //setting the pulse width
207+
OCR5B = this->defaultPos; //setting the pulse width
208208

209209
//OC5B, Port L, Bit 4; setting pin 45 as output:
210210
DDRL |= (1 << PL4); //bit 4 (pin 45) as output

src/Servo_Hardware_PWM.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class Servo
7171
Servo();
7272
uint8_t attach(int pin); //attach the given pin; returns servoIndex number or 255 if too many servos
7373
uint8_t attach(int pin, int min, int max); //attach the given pin and set the upper and lower pulse width limits; returns servoIndex number or 255 if too many servos
74-
uint8_t attach(int pin, int min, int max, int default); //attach the given pin, set the upper and lower pulse width limits and set the pulse width when servo is attached; returns servoIndex number or 255 if too many servos
74+
uint8_t attach(int pin, int min, int max, int defaultPos); //attach the given pin, set the upper and lower pulse width limits and set the pulse width when servo is attached; returns servoIndex number or 255 if too many servos
7575
void detach(); //detach the used pin
7676
void detachAll(); //automatically detaches all used pins
7777
void write(int value); //write angle in degrees
@@ -81,7 +81,7 @@ class Servo
8181
uint8_t servoPin; //pin number of the attached Servo
8282
uint8_t min; //lower pulse width limit
8383
uint8_t max; //upper pulse width limit
84-
uint8_t default; //pulse width when servo is attached
84+
uint8_t defaultPos; //pulse width when servo is attached
8585
};
8686

8787
#endif

0 commit comments

Comments
 (0)