File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 4848ir = InfraredSensor (); assert ir .connected
4949ts = TouchSensor (); assert ts .connected
5050
51+ print ('Robot Starting' )
52+
5153# We will need to check EV3 buttons state.
5254btn = 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
You can’t perform that action at this time.
0 commit comments