Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switching GPIOPWM to on tries to create a new PWM object #242

Open
PaulKGrimes opened this issue Mar 1, 2020 · 0 comments · May be fixed by #243
Open

Switching GPIOPWM to on tries to create a new PWM object #242

PaulKGrimes opened this issue Mar 1, 2020 · 0 comments · May be fixed by #243

Comments

@PaulKGrimes
Copy link

Every time GPIOPWM.on() is called, it tries to create a new PWM.GPIO object, attached to the actor's GPIO pin (line 56 of modules/base_plugins/gpio_actor/init.py). This raises an exception as PWM.GPIO does not like to create a new object attached to a pin that has already been assigned, and requires that the control be pressed a second time to switch the actor on.

The simple way to prevent this is to check whether the PWM object exists with if self.p is None: and only try create the PWM object if it doesn't already exist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant