Skip to content

Commit 7cb5cb0

Browse files
committed
Update demos for python3
1 parent 52d9ec1 commit 7cb5cb0

File tree

15 files changed

+65
-42
lines changed

15 files changed

+65
-42
lines changed

demo/BALANC3R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22

33
import logging
44
from ev3dev.GyroBalancer import GyroBalancer

demo/MINDCUB3R/rubiks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22

33
from ev3dev.auto import OUTPUT_A, OUTPUT_B, OUTPUT_C, InfraredSensor
44
from ev3dev.helper import LargeMotor, MediumMotor, ColorSensor, MotorStall

demo/MINDCUB3R/rubiks_rgb_solver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22

33
from itertools import permutations
44
from math import atan2, cos, degrees, exp, factorial, radians, sin, sqrt

demo/lego_official_projects/EV3D4.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22

33
import logging
44
import sys

demo/lego_official_projects/EV3D4RemoteControl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22

33
from EV3D4 import EV3D4RemoteControlled
44
import logging

demo/lego_official_projects/EV3D4WebControl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22

33
from EV3D4 import EV3D4WebControlled
44
import logging

demo/lego_official_projects/TRACK3R.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22

33
import logging
44
import sys
@@ -35,7 +35,7 @@ def __init__(self, medium_motor=OUTPUT_A, left_motor=OUTPUT_B, right_motor=OUTPU
3535

3636
def fire_ball(self, state):
3737
if state:
38-
self.medium_motor.run_to_rel_pos(duty_cycle_sp=100, position_sp=3*360)
38+
self.medium_motor.run_to_rel_pos(speed_sp=100, position_sp=3*360)
3939
else:
4040
self.medium_motor.stop()
4141

@@ -48,7 +48,7 @@ def __init__(self, medium_motor=OUTPUT_A, left_motor=OUTPUT_B, right_motor=OUTPU
4848

4949
def spinner(self, state):
5050
if state:
51-
self.medium_motor.run_forever(duty_cycle_sp=50)
51+
self.medium_motor.run_forever(speed_sp=50)
5252
else:
5353
self.medium_motor.stop()
5454

@@ -61,6 +61,6 @@ def __init__(self, medium_motor=OUTPUT_A, left_motor=OUTPUT_B, right_motor=OUTPU
6161

6262
def move_claw(self, state):
6363
if state:
64-
self.medium_motor.run_to_rel_pos(duty_cycle_sp=40, position_sp=-75)
64+
self.medium_motor.run_to_rel_pos(speed_sp=40, position_sp=-75)
6565
else:
66-
self.medium_motor.run_to_rel_pos(duty_cycle_sp=40, position_sp=75)
66+
self.medium_motor.run_to_rel_pos(speed_sp=40, position_sp=75)

demo/lego_official_projects/TRACK3RWithBallShooter

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22

33
import logging
44
from TRACK3R import TRACK3RWithBallShooter

demo/lego_official_projects/TRACK3RWithClaw

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22

33
import logging
44
from TRACK3R import TRACK3RWithClaw

demo/lego_official_projects/TRACK3RWithSpinner

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22

33
import logging
44
from TRACK3R import TRACK3RWithSpinner

0 commit comments

Comments
 (0)