@@ -33,7 +33,7 @@ def test_single_coil():
33
33
motor = stepper .StepperMotor (coil [2 ], coil [0 ], coil [1 ], coil [3 ])
34
34
# Always start with a single step.
35
35
for j in range (4 ):
36
- assert coil [j ].duty_cycle == ( 0xffff if j == 0 else 0 )
36
+ assert coil [j ].duty_cycle == 0
37
37
for i in range (1 , 7 ): # Test 6 steps so we wrap around
38
38
motor .onestep ()
39
39
for j in range (4 ):
@@ -45,7 +45,7 @@ def test_double_coil():
45
45
motor = stepper .StepperMotor (coil [2 ], coil [0 ], coil [1 ], coil [3 ])
46
46
# Despite double stepping we always start with a single step.
47
47
for j in range (4 ):
48
- assert coil [j ].duty_cycle == ( 0xffff if j == 0 else 0 )
48
+ assert coil [j ].duty_cycle == 0
49
49
for i in range (6 ): # Test 6 steps so we wrap around
50
50
motor .onestep (style = stepper .DOUBLE )
51
51
for j in range (4 ):
@@ -57,7 +57,7 @@ def test_interleave_steps():
57
57
motor = stepper .StepperMotor (coil [2 ], coil [0 ], coil [1 ], coil [3 ])
58
58
# We always start with a single step.
59
59
for j in range (4 ):
60
- assert coil [j ].duty_cycle == ( 0xffff if j == 0 else 0 )
60
+ assert coil [j ].duty_cycle == 0
61
61
for i in range (15 ): # Test 15 half steps so we wrap around
62
62
motor .onestep (style = stepper .INTERLEAVE )
63
63
for j in range (4 ):
@@ -83,7 +83,7 @@ def test_microstep_steps():
83
83
motor = stepper .StepperMotor (coil [2 ], coil [0 ], coil [1 ], coil [3 ], microsteps = 2 )
84
84
# We always start with a single step.
85
85
for j in range (4 ):
86
- assert coil [j ].duty_cycle == ( 0xffff if j == 0 else 0 )
86
+ assert coil [j ].duty_cycle == 0
87
87
motor .onestep (style = stepper .MICROSTEP )
88
88
assert coil [0 ].duty_cycle == 0xb504
89
89
assert coil [1 ].duty_cycle == 0xb504
@@ -114,7 +114,7 @@ def test_double_to_single():
114
114
motor = stepper .StepperMotor (coil [2 ], coil [0 ], coil [1 ], coil [3 ])
115
115
# We always start with a single step.
116
116
for j in range (4 ):
117
- assert coil [j ].duty_cycle == ( 0xffff if j == 0 else 0 )
117
+ assert coil [j ].duty_cycle == 0
118
118
119
119
motor .onestep (direction = stepper .BACKWARD , style = stepper .DOUBLE )
120
120
assert coil [0 ].duty_cycle == 0xffff
@@ -146,7 +146,7 @@ def test_microstep_to_single():
146
146
motor = stepper .StepperMotor (coil [2 ], coil [0 ], coil [1 ], coil [3 ])
147
147
# We always start with a single step.
148
148
for j in range (4 ):
149
- assert coil [j ].duty_cycle == ( 0xffff if j == 0 else 0 )
149
+ assert coil [j ].duty_cycle == 0
150
150
151
151
motor .onestep (direction = stepper .BACKWARD , style = stepper .MICROSTEP )
152
152
assert coil [0 ].duty_cycle == 0xfec3
0 commit comments