mirror of
https://github.com/KevinMidboe/python-gpiozero.git
synced 2025-12-08 20:39:01 +00:00
Check enable is not None, in case it's GPIO0
This commit is contained in:
@@ -814,7 +814,7 @@ class Motor(SourceMixin, CompositeDevice):
|
|||||||
'forward and backward pins must be provided'
|
'forward and backward pins must be provided'
|
||||||
)
|
)
|
||||||
PinClass = PWMOutputDevice if pwm else DigitalOutputDevice
|
PinClass = PWMOutputDevice if pwm else DigitalOutputDevice
|
||||||
if enable:
|
if enable is not None:
|
||||||
super(Motor, self).__init__(
|
super(Motor, self).__init__(
|
||||||
forward_device=PinClass(forward),
|
forward_device=PinClass(forward),
|
||||||
backward_device=PinClass(backward),
|
backward_device=PinClass(backward),
|
||||||
|
|||||||
Reference in New Issue
Block a user