@@ -91,12 +91,12 @@ void Servo::detach()
91
91
void Servo::write (int value)
92
92
{
93
93
// treat values less than 544 as angles in degrees (valid values in microseconds are handled as microseconds)
94
- if (value < MIN_PULSE_WIDTH ) {
94
+ if (value < _minUs ) {
95
95
// assumed to be 0-180 degrees servo
96
96
value = constrain (value, 0 , 180 );
97
97
// writeMicroseconds will contrain the calculated value for us
98
98
// for any user defined min and max, but we must use default min max
99
- value = improved_map (value, 0 , 180 , MIN_PULSE_WIDTH, MAX_PULSE_WIDTH );
99
+ value = improved_map (value, 0 , 180 , _minUs, _maxUs );
100
100
}
101
101
writeMicroseconds (value);
102
102
}
@@ -113,7 +113,7 @@ int Servo::read() // return the value as degrees
113
113
{
114
114
// read returns the angle for an assumed 0-180, so we calculate using
115
115
// the normal min/max constants and not user defined ones
116
- return improved_map (readMicroseconds (), MIN_PULSE_WIDTH, MAX_PULSE_WIDTH , 0 , 180 );
116
+ return improved_map (readMicroseconds (), _minUs, _maxUs , 0 , 180 );
117
117
}
118
118
119
119
int Servo::readMicroseconds ()
0 commit comments