Skip to content

Commit 433a19b

Browse files
author
Martin O'Hanlon
committed
fixed test_pwm_output_device_alt_values
1 parent 3a17c62 commit 433a19b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/test_picozero.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,10 @@ def test_pwm_output_device_alt_values(self):
179179
self.assertEqual(d.freq, 200)
180180

181181
d.off()
182-
# pwm returns 1 less than the duty_factor unless the duty is set to the maximum 65535
183-
self.assertEqual(d._pwm.duty_u16(), 9999)
182+
# prior to micropython v1.20 PWM returned 1 less than the duty_factor
183+
# unless the duty was set to the maximum 65535
184+
# self.assertEqual(d._pwm.duty_u16(), 9999)
185+
self.assertEqual(d._pwm.duty_u16(), 10000)
184186
self.assertAlmostEqual(d.value, 0, places=2)
185187

186188
d.on()

0 commit comments

Comments
 (0)