mirror of
https://github.com/KevinMidboe/python-gpiozero.git
synced 2025-10-29 17:50:37 +00:00
Fix faulty PWMOutputDevice value setter
This commit is contained in:
@@ -196,12 +196,12 @@ class PWMOutputDevice(DigitalOutputDevice):
|
|||||||
_min = self._min_pwm
|
_min = self._min_pwm
|
||||||
_max = self._max_pwm
|
_max = self._max_pwm
|
||||||
if _min <= n <= _max:
|
if _min <= n <= _max:
|
||||||
n *= 100
|
dc = n * 100
|
||||||
else:
|
else:
|
||||||
raise GPIODeviceError(
|
raise GPIODeviceError(
|
||||||
"Value must be between %s and %s" % (_min, _max)
|
"Value must be between %s and %s" % (_min, _max)
|
||||||
)
|
)
|
||||||
self._pwm.ChangeDutyCycle(n)
|
self._pwm.ChangeDutyCycle(dc)
|
||||||
self._value = n
|
self._value = n
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user