File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed
Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -209,21 +209,14 @@ void HandServos::moveServos2(String input) {
209209 Serial.println (pieces[2 ]);
210210 Serial.println (pieces[3 ]);
211211
212- // T
213- if (lastPosT > pieces[0 ].toInt ()) {
214- for (int i = lastPosT; i > pieces[0 ].toInt (); i--) {
215- servoT.write (i);
216- lastPosT = servoT.read ();
217- delay (15 );
218- }
219- } else if (lastPosT > pieces[0 ].toInt ()) {
212+ if (lastPosT < pieces[0 ].toInt ()) {
220213 for (int i = lastPosT; i < pieces[0 ].toInt (); i++) {
221214 servoT.write (i);
222215 lastPosT = servoT.read ();
223216 delay (15 );
224217 }
225218 }
226-
219+
227220 // I
228221 if (lastPosI > pieces[1 ].toInt ()) {
229222 for (int i = lastPosI; i > pieces[1 ].toInt (); i--) {
@@ -268,4 +261,12 @@ void HandServos::moveServos2(String input) {
268261 delay (15 );
269262 }
270263 }
264+
265+ if (lastPosT > pieces[0 ].toInt ()) {
266+ for (int i = lastPosT; i > pieces[0 ].toInt (); i--) {
267+ servoT.write (i);
268+ lastPosT = servoT.read ();
269+ delay (15 );
270+ }
271+ }
271272}
You can’t perform that action at this time.
0 commit comments