]> Repositories - Adafruit_Blinka-hackapet.git/blobdiff - src/adafruit_blinka/microcontroller/generic_linux/sysfs_pwmout.py
add property to period methods
[Adafruit_Blinka-hackapet.git] / src / adafruit_blinka / microcontroller / generic_linux / sysfs_pwmout.py
index ce20a9fe228bfcae178781abfa098e2a4a25e9fb..e13b112687eb96b05cd00d6da052f093609bca18 100644 (file)
@@ -95,7 +95,7 @@ class PWMOut(object):
         # Look up the period, for fast duty cycle updates
         self._period = self._get_period()
 
         # Look up the period, for fast duty cycle updates
         self._period = self._get_period()
 
-        self.duty_cycle = 0
+        #self.duty_cycle = 0  # This line causes a write error when trying to enable
 
         # set frequency
         self.frequency = freq
 
         # set frequency
         self.frequency = freq
@@ -167,6 +167,8 @@ class PWMOut(object):
         # Update our cached period
         self._period = float(period)
 
         # Update our cached period
         self._period = float(period)
 
+    period = property(_get_period, _set_period)
+
     """Get or set the PWM's output period in seconds.
 
     Raises:
     """Get or set the PWM's output period in seconds.
 
     Raises: