Skip to content

Commit 92adf3b

Browse files
committed
Merge tag 'Release_v1_2_0' into develop
1.2.0 Release_v1_2_0
2 parents 6e62a15 + 5a44675 commit 92adf3b

File tree

5 files changed

+10
-9
lines changed

5 files changed

+10
-9
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ This library can be installed through the Arduino IDE library manager like so:
1616

1717
### Note
1818
Starting from version 1.2.0 this Servo-Library is compatible with all the [original Arduino Servo Library](https://github.com/arduino-libraries/Servo) - commands available. In addition to these "standard"-functions, following commands are added:
19-
* ``` attach(int pin, int min, int max, int defaultPos)``` - Besides the ability of setting the servo pin and the upper and lower pulse width limit, the starting pulse width of the servo can be set with the defaultPos. This allows the servo to start from a user defined angle instead of the middle position.
20-
* ```detachAll()``` - This feature allows to detach all servos at once.
19+
* ``` attach(int pin, int min, int max, int defaultPos)``` - Besides the ability to set the servo pin and the upper and lower pulse width limit, the starting pulse width of the servo can be set with the defaultPos. This allows the servo to start from a user-defined angle instead of the middle position.
20+
* ```detachAll()``` - This feature allows detaching all servos at once.
2121

2222
### Built With
2323
* [Visual Studio 2019](https://visualstudio.microsoft.com/) - IDE used for programming

examples/Servo_Sweep/Servo_Sweep.ino

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/* Servo Sweep
2-
by Daniel Duller 12. January 2019
2+
Created by Daniel Duller, 12. January, 2019.
3+
Changed by Daniel Duller, 11. October, 2019.
34
This example code is in the public domain.
45
*/
56

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=Servo Hardware PWM
2-
version=1.0.1
2+
version=1.2.0
33
author=Daniel Duller <daniel.duller@gmx.net>
44
maintainer=Daniel Duller <daniel.duller@gmx.net>
55
sentence=Allows Arduino/Genuino Mega boards to control up to 6 servos with the integrated 16-bit hardware PWM timer/counter.

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: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
Servo_Hardware_PWM.h - This Library allows Arduino/Genuino Mega boards to control up to 6 servos with the integrated 16-bit hardware PWM timer/counter.
33
Created by Daniel Duller, 11. January, 2019.
4-
Changed by Daniel Duller, 14. January, 2019.
4+
Changed by Daniel Duller, 11. October, 2019.
55
66
###############################################################################
77
MIT License
@@ -44,7 +44,7 @@
4444
attach(pin, min, max) --- Attaches a servo motor to an i/o pin with a custom lower and upper pulse width limit.
4545
4646
attach(pin, min, max, defaultPos) --- Attaches a servo motor to an i/o pin with a custom lower and upper pulse width limit.
47-
In addition, the starting pulse width of the servo can bes set with the defaultPos.
47+
In addition, the starting pulse width of the servo can be set with the defaultPos.
4848
This allows the servo to start from a user-defined angle instead of the middle position.
4949
5050
detach() --- Clears the used registers and stops the output of the attached pin. (no pin number!)
@@ -71,11 +71,11 @@
7171
#error "This library only supports boards with an AVR processor."
7272
#endif
7373

74-
#define VERSION 1.0.1 //software version of this library
74+
#define Servo_VERSION 1.0.1 //software version of this library
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)