This repository was archived by the owner on Feb 21, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +6
-26
lines changed Expand file tree Collapse file tree 2 files changed +6
-26
lines changed Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ Default implementation
88
88
*/
89
89
unsigned int _Braccio::begin () {
90
90
// SOFT_START_SLOW is the default value
91
- return begin (SOFT_START_SLOW );
91
+ return begin (0 );
92
92
}
93
93
94
94
/*
@@ -111,27 +111,11 @@ The SOFT_START_CONTROL_PIN is used as a software PWM
111
111
*/
112
112
void _Braccio::_softStart (int soft_start_level){
113
113
long int tmp=millis ();
114
- if (soft_start_level==SOFT_START_FAST){
115
- while (millis ()-tmp < LOW_LIMIT_TIMEOUT)
116
- _softwarePWM (125 , 50 );
114
+ while (millis ()-tmp < LOW_LIMIT_TIMEOUT)
115
+ _softwarePWM (30 +soft_start_level, 500 - soft_start_level);
117
116
118
- while (millis ()-tmp < HIGH_LIMIT_TIMEOUT)
119
- _softwarePWM (125 , 105 );
120
-
121
- }else if (soft_start_level==SOFT_START_MEDIUM){
122
- while (millis ()-tmp < LOW_LIMIT_TIMEOUT)
123
- _softwarePWM (15 , 125 );
124
-
125
- while (millis ()-tmp < HIGH_LIMIT_TIMEOUT)
126
- _softwarePWM (15 , 145 );
127
-
128
- }else if (soft_start_level==SOFT_START_SLOW){
129
- while (millis ()-tmp < LOW_LIMIT_TIMEOUT)
130
- _softwarePWM (15 , 155 );
131
-
132
- while (millis ()-tmp < HIGH_LIMIT_TIMEOUT)
133
- _softwarePWM (5 , 165 );
134
- }
117
+ while (millis ()-tmp < HIGH_LIMIT_TIMEOUT)
118
+ _softwarePWM (25 + soft_start_level, 480 - soft_start_level);
135
119
136
120
digitalWrite (SOFT_START_CONTROL_PIN,HIGH);
137
121
}
Original file line number Diff line number Diff line change 24
24
#include < Servo.h>
25
25
26
26
// You should set begin(SOFT_START_DISABLED) if you are using the Arm Robot shield V1.6
27
- #define SOFT_START_DISABLED 0
28
- // You can set different values for the softstart. SOFT_START_SLOW is the default value
29
- #define SOFT_START_FAST 2
30
- #define SOFT_START_MEDIUM 3
31
- #define SOFT_START_SLOW 4
27
+ #define SOFT_START_DISABLED -999
32
28
33
29
// The software PWM is connected to PIN 12. You cannot use the pin 12 if you are using
34
30
// a Braccio shield V4 or newer
You can’t perform that action at this time.
0 commit comments