Skip to content

Commit 790c2cf

Browse files
committed
Merge branch 'develop' of https://github.com/dwalton76/ev3dev-lang-python into develop-misc
2 parents e40637d + 8f33b80 commit 790c2cf

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

demo/EXPLOR3R/auto-drive.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@
4848
ir = InfraredSensor(); assert ir.connected
4949
ts = TouchSensor(); assert ts.connected
5050

51+
print('Robot Starting')
52+
5153
# We will need to check EV3 buttons state.
5254
btn = Button()
5355

@@ -76,7 +78,7 @@ def backup():
7678
# until both motors are stopped before continuing.
7779
for m in motors:
7880
m.stop(stop_action='brake')
79-
m.run_timed(duty_cycle_sp=-50, time_sp=1500)
81+
m.run_timed(speed_sp=-500, time_sp=1500)
8082

8183
# When motor is stopped, its `state` attribute returns empty list.
8284
# Wait until both motors are stopped:
@@ -99,7 +101,7 @@ def turn():
99101
t = randint(250, 750)
100102

101103
for m, p in zip(motors, power):
102-
m.run_timed(duty_cycle_sp=p*75, time_sp=t)
104+
m.run_timed(speed_sp = p * 750, time_sp = t)
103105

104106
# Wait until both motors are stopped:
105107
while any(m.state for m in motors):
@@ -122,10 +124,10 @@ def turn():
122124

123125
if distance > 60:
124126
# Path is clear, run at full speed.
125-
dc = 90
127+
dc = 95
126128
else:
127129
# Obstacle ahead, slow down.
128-
dc = 40
130+
dc = 30
129131

130132
for m in motors:
131133
m.duty_cycle_sp = dc

ev3dev/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -874,7 +874,7 @@ def wait_while(self, s, timeout=None):
874874
immediately after starting the motor even if it is not actually
875875
being prevented from rotating. As a workaround, we recommend
876876
sleeping your code for around 100ms after starting a motor if you
877-
are going to use this method to wait for it to be ``stalled``. A
877+
are going to use this method to wait while it is ``stalled``. A
878878
fix for this has not yet been released.
879879
880880
Returns ``True`` if the condition is met, and ``False`` if the timeout

0 commit comments

Comments
 (0)