File tree 1 file changed +2
-1
lines changed
1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,7 @@ def deinit(self):
65
65
self ._pwm_pin = None
66
66
67
67
def _is_deinited (self ):
68
+ """Checks if PWMOut object has been previously de-initalized"""
68
69
if self ._pwm_pin is None :
69
70
raise ValueError ("PWMOut Object has been deinitialized and can no longer "
70
71
"be used. Create a new PWMOut object." )
@@ -85,7 +86,6 @@ def duty_cycle(self, duty_cycle):
85
86
self ._is_deinited ()
86
87
if not isinstance (duty_cycle , (int , float )):
87
88
raise TypeError ("Invalid duty_cycle, should be int or float." )
88
-
89
89
duty_cycle /= 65535.0
90
90
if not 0.0 <= duty_cycle <= 1.0 :
91
91
raise ValueError ("Invalid duty_cycle, should be between 0.0 and 1.0" )
@@ -104,4 +104,5 @@ def frequency(self, freq):
104
104
NOTE: Only writeable when constructed with variable_Frequency=True.
105
105
"""
106
106
self ._is_deinited ()
107
+ self ._freq = freq
107
108
raise NotImplementedError ("PWMOut Frequency not implemented in ESP32SPI" )
You can’t perform that action at this time.
0 commit comments