Menu

#76 Stop PWM thread immediately when stop() is called

New
nobody
None
High
Enhancement
2014-09-25
2014-09-25
Techhead
No

The PWM thread stops only when the full body of the loop ends. After that, the GPIO port is set to low. Imagine that you have started a PWM which runs with a one minute frequency (blinking once in a minute). Then you stop it and start a new PWM with a 1 sec frequency. This second thread stats nicely but when the first thread exists (a few seconds later) it resets the GPIO port to low and masses up all previous setups. The best solution would be to "kill" the thread immediately, wait for its termination or do not set the GPIO port after exiting the loop. What do you think?

Discussion


Log in to post a comment.

MongoDB Logo MongoDB