Skip to content

Commit 2693552

Browse files
committed
Adjusted DriveBump to use the motor.max_speed from the left motor, instead of 1050, to work with other motor types.
1 parent e554958 commit 2693552

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

FLLMaster/DriveLibraries.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ def DriveBump(self, Heading, Speed):
219219

220220
# Check and store the sign of the input speed (for PID correction), and convert the target speed to encoder ticks per second
221221
sign = Speed * -1 / abs(Speed)
222-
target = abs((1050 * Speed) / 100)
222+
target = abs((self.lm.max_speed * Speed) / 100)
223223

224224
# Initialize variables for PID control
225225
integral = 0.0

FLLMaster/Main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
R1.zeroGyro()
88
#R1.spkr.speak("Starting")
99
R1.spkr.beep()
10-
R1.DriveBump(0, -30)
10+
R1.DriveBump(0, 30)

0 commit comments

Comments
 (0)