Skip to content

Commit 726b4ea

Browse files
author
Chris Anderson
authored
Fixed typos
1 parent 3b49e06 commit 726b4ea

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

examples/Robot.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,10 @@
1616
kit = MotorKit()
1717

1818
class Robot(object):
19-
def __init__(self, addr=0x60, left_id=1, right_id=2, left_trim=0, right_trim=0,
19+
def __init__(self, left_trim=0, right_trim=0,
2020
stop_at_exit=True):
2121
"""Create an instance of the robot. Can specify the following optional
22-
parameters:
23-
- addr: The I2C address of the motor HAT, default is 0x60.
24-
- left_id: The ID of the left motor, default is 1.
25-
- right_id: The ID of the right motor, default is 2.
22+
parameter
2623
- left_trim: Amount to offset the speed of the left motor, can be positive
2724
or negative and use useful for matching the speed of both
2825
motors. Default is 0.
@@ -72,8 +69,7 @@ def forward(self, speed, seconds=None):
7269
self.stop()
7370

7471
def steer(self, speed, direction):
75-
"""Move forward at the specified speed (0- 1). Direction is +- 1. Full left is -1, Full right is +1.
76-
"""
72+
# Move forward at the specified speed (0- 1). Direction is +- 1. Full left is -1, Full right is +1
7773
if (speed + direction/2) > 1:
7874
speed = speed - direction/2 # calibrate so total motor output never goes above 1
7975
left = speed + direction/2

0 commit comments

Comments
 (0)