Skip to content

Commit

Permalink
Python example - Fixes emlid#28
Browse files Browse the repository at this point in the history
After pwm-channel deinitialization some configurations seems to linger.
This causes pwm outputs to potentially get an unexpected behaviour.

By simply setting period to 1, the pwm output will behave as default
after deinitialization.
  • Loading branch information
drobban authored and staroselskii committed Dec 19, 2017
1 parent 84573fe commit e63dbe6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Python/navio/pwm.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def __exit__(self, *args):

def deinitialize(self):
if self.is_enabled:
self.set_period(1)
self.disable()
with open(self.SYSFS_PWM_UNEXPORT_PATH, "a") as pwm_unexport:
pwm_unexport.write(str(self.channel))
Expand Down

0 comments on commit e63dbe6

Please sign in to comment.