Merge pull request #28 from egoistka/pwm-stop
Add p.stop() for PWM pin for cleanup
This commit is contained in:
@@ -41,6 +41,7 @@ def stopAlertor():
|
||||
|
||||
def destroy():
|
||||
GPIO.output(buzzerPin, GPIO.LOW) # Turn off buzzer
|
||||
p.stop() # stop PWM
|
||||
GPIO.cleanup() # Release GPIO resource
|
||||
|
||||
if __name__ == '__main__': # Program entrance
|
||||
|
||||
@@ -38,6 +38,7 @@ def loop():
|
||||
time.sleep(0.03)
|
||||
|
||||
def destroy():
|
||||
p.stop() # stop PWM
|
||||
GPIO.cleanup()
|
||||
adc.close()
|
||||
|
||||
|
||||
@@ -53,6 +53,9 @@ def loop():
|
||||
|
||||
def destroy():
|
||||
adc.close()
|
||||
p_Red.stop() # stop PWM
|
||||
p_Green.stop() # stop PWM
|
||||
p_Blue.stop() # stop PWM
|
||||
GPIO.cleanup()
|
||||
|
||||
if __name__ == '__main__': # Program entrance
|
||||
|
||||
@@ -41,6 +41,7 @@ def loop():
|
||||
|
||||
def destroy():
|
||||
adc.close()
|
||||
p.stop() # stop PWM
|
||||
GPIO.cleanup()
|
||||
|
||||
if __name__ == '__main__': # Program entrance
|
||||
|
||||
@@ -65,6 +65,7 @@ def loop():
|
||||
time.sleep(0.01)
|
||||
|
||||
def destroy():
|
||||
p.stop() # stop PWM
|
||||
GPIO.cleanup()
|
||||
|
||||
if __name__ == '__main__': # Program entrance
|
||||
|
||||
Reference in New Issue
Block a user