@@ -28,12 +28,12 @@ const int servo2Offset = 120;
2828const int servo3Offset = 240 ;
2929
3030// Pins that all servos are attached to
31- const int servoSpeed1Pin = 22 ; // Servo in the FRONT of robot
32- const int servoSpeed2Pin = 24 ; // Servo on the BACK Drivers Side
33- const int servoSpeed3Pin = 26 ; // Servo on the BACK Passenger Side
34- const int servoTurn1Pin = 23 ; // Servo in the FRONT of robot
35- const int servoTurn2Pin = 25 ; // Servo on the BACK Drivers Side
36- const int servoTurn3Pin = 27 ; // Servo on the BACK Passenger Side
31+ const int servoSpeed1Pin = 23 ; // Servo in the FRONT of robot
32+ const int servoSpeed2Pin = 25 ; // Servo on the BACK Drivers Side
33+ const int servoSpeed3Pin = 27 ; // Servo on the BACK Passenger Side
34+ const int servoTurn1Pin = 22 ; // Servo in the FRONT of robot
35+ const int servoTurn2Pin = 24 ; // Servo on the BACK Drivers Side
36+ const int servoTurn3Pin = 26 ; // Servo on the BACK Passenger Side
3737
3838// Set all Pins to starting values
3939int currentSpeedServo1 = 0 ;
@@ -111,9 +111,9 @@ void loop()
111111 // Scale values to a range of -100 to 100
112112 // to be multiplied by the speed constant
113113 if ( speedFactor > 0 )
114- speedFactor = map (speedFactor, 7500 , 32767 , 0 , 25 );
114+ speedFactor = map (speedFactor, 7500 , 32767 , 0 , 100 );
115115 else
116- speedFactor = map (speedFactor, -32767 , -7500 , -25 , 0 );
116+ speedFactor = map (speedFactor, -32767 , -7500 , -100 , 0 );
117117
118118 speedFactor *= speedScale;
119119 }
@@ -281,46 +281,31 @@ void loop()
281281 }
282282 if (Xbox.getButtonClick (R1, 0 ))
283283 {
284- if (speedScale < 20 )
284+ if (speedScale < 5 )
285285 {
286286 speedScale++;
287287 }
288288 }
289289
290290 switch (speedScale)
291291 {
292- case 20 :
293- Xbox.setLedMode (ALTERNATING , 0 );
292+ case 5 :
293+ Xbox.setLedBlink (ALL , 0 );
294294 break ;
295- case 19 :
296- case 18 :
297- case 17 :
298- case 16 :
295+ case 4 :
299296 Xbox.setLedOn (LED4, 0 );
300297 break ;
301- case 15 :
302- case 14 :
303- case 13 :
304- case 12 :
305- case 11 :
298+ case 3 :
306299 Xbox.setLedOn (LED3, 0 );
307300 break ;
308- case 10 :
309- case 9 :
310- case 8 :
311- case 7 :
312- case 6 :
301+ case 2 :
313302 Xbox.setLedOn (LED2, 0 );
314303 break ;
315- case 5 :
316- case 4 :
317- case 3 :
318- case 2 :
319304 case 1 :
320305 Xbox.setLedOn (LED1, 0 );
321306 break ;
322307 case 0 :
323- Xbox.setLedBlink (ALL , 0 );
308+ Xbox.setLedMode (ALTERNATING , 0 );
324309 break ;
325310 }
326311 }
0 commit comments