From 3ce4151bb75aed7c950bc547a6402b8f91c5937d Mon Sep 17 00:00:00 2001 From: Ben Nuttall Date: Mon, 12 Oct 2015 00:24:46 +0100 Subject: [PATCH] Fix faulty PWMOutputDevice value setter --- gpiozero/output_devices.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gpiozero/output_devices.py b/gpiozero/output_devices.py index 6fda82a..6c08d72 100644 --- a/gpiozero/output_devices.py +++ b/gpiozero/output_devices.py @@ -196,12 +196,12 @@ class PWMOutputDevice(DigitalOutputDevice): _min = self._min_pwm _max = self._max_pwm if _min <= n <= _max: - n *= 100 + dc = n * 100 else: raise GPIODeviceError( "Value must be between %s and %s" % (_min, _max) ) - self._pwm.ChangeDutyCycle(n) + self._pwm.ChangeDutyCycle(dc) self._value = n