fix crash on init caused by the previous change :)
This commit is contained in:
parent
6a713c5b7e
commit
187cb354ca
1 changed files with 3 additions and 6 deletions
9
fand.py
9
fand.py
|
@ -46,6 +46,9 @@ class PWM:
|
|||
# disable channel
|
||||
self.set_enabled(False)
|
||||
|
||||
# acquire a duty cycle file descriptor
|
||||
self.f_dc = open(self.ch_base + "duty_cycle", "w")
|
||||
|
||||
# set 0 duty cycle so period can be freely set
|
||||
self.set_duty_cycle(0)
|
||||
|
||||
|
@ -56,12 +59,6 @@ class PWM:
|
|||
with open(self.ch_base + "polarity", "w") as f:
|
||||
f.write("normal")
|
||||
|
||||
# acquire a duty cycle file descriptor
|
||||
self.f_dc = open(self.ch_base + "duty_cycle", "w")
|
||||
|
||||
# set to idle
|
||||
self.set_percent(0)
|
||||
|
||||
# re-enable channel
|
||||
self.set_enabled(True)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue