Skip to content

Commit 1e91fd3

Browse files
committed
update description of write method
1 parent 57a6f98 commit 1e91fd3

File tree

6 files changed

+2
-6
lines changed

6 files changed

+2
-6
lines changed

src/Servo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ class Servo
108108
uint8_t attach(int pin); // attach the given pin to the next free channel, sets pinMode, returns channel number or INVALID_SERVO if failure
109109
uint8_t attach(int pin, int min, int max); // as above but also sets min and max values for writes.
110110
void detach();
111-
void write(int value); // if value is < 200 its treated as an angle, otherwise as pulse width in microseconds
111+
void write(int value); // if value is < 544 and desired arch is not nrf52, its treated as an angle, otherwise as pulse width in microseconds
112112
void writeMicroseconds(int value); // Write pulse width in microseconds
113113
int read(); // returns current pulse width as an angle between 0 and 180 degrees
114114
int readMicroseconds(); // returns current pulse width in microseconds for this servo (was read_us() in first release)

src/avr/Servo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ void Servo::detach()
264264
void Servo::write(int value)
265265
{
266266
if(value < MIN_PULSE_WIDTH)
267-
{ // treat values less than 544 as angles in degrees (valid values in microseconds are handled as microseconds)
267+
{
268268
if(value < 0) value = 0;
269269
if(value > 180) value = 180;
270270
value = map(value, 0, 180, SERVO_MIN(), SERVO_MAX());

src/mbed/Servo.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ void Servo::detach()
8383

8484
void Servo::write(int value)
8585
{
86-
// treat values less than 544 as angles in degrees (valid values in microseconds are handled as microseconds)
8786
if (value < MIN_PULSE_WIDTH)
8887
{
8988
if (value < 0)

src/megaavr/Servo.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@ void Servo::detach()
160160

161161
void Servo::write(int value)
162162
{
163-
// treat values less than 544 as angles in degrees (valid values in microseconds are handled as microseconds)
164163
if (value < MIN_PULSE_WIDTH)
165164
{
166165
if (value < 0)

src/sam/Servo.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,6 @@ void Servo::detach()
228228

229229
void Servo::write(int value)
230230
{
231-
// treat values less than 544 as angles in degrees (valid values in microseconds are handled as microseconds)
232231
if (value < MIN_PULSE_WIDTH)
233232
{
234233
if (value < 0)

src/samd/Servo.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,6 @@ void Servo::detach()
243243

244244
void Servo::write(int value)
245245
{
246-
// treat values less than 544 as angles in degrees (valid values in microseconds are handled as microseconds)
247246
if (value < MIN_PULSE_WIDTH)
248247
{
249248
if (value < 0)

0 commit comments

Comments
 (0)