diff --git a/Code/Python_Code/06.2.1_Alertor/Alertor.py b/Code/Python_Code/06.2.1_Alertor/Alertor.py index fe801d3..a329abd 100644 --- a/Code/Python_Code/06.2.1_Alertor/Alertor.py +++ b/Code/Python_Code/06.2.1_Alertor/Alertor.py @@ -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 diff --git a/Code/Python_Code/08.1.1_Softlight/Softlight.py b/Code/Python_Code/08.1.1_Softlight/Softlight.py index 2a753bf..ad3f4ea 100644 --- a/Code/Python_Code/08.1.1_Softlight/Softlight.py +++ b/Code/Python_Code/08.1.1_Softlight/Softlight.py @@ -38,6 +38,7 @@ def loop(): time.sleep(0.03) def destroy(): + p.stop() # stop PWM GPIO.cleanup() adc.close() diff --git a/Code/Python_Code/09.1.1_ColorfulSoftlight/ColorfulSoftlight.py b/Code/Python_Code/09.1.1_ColorfulSoftlight/ColorfulSoftlight.py index d033603..58729ec 100644 --- a/Code/Python_Code/09.1.1_ColorfulSoftlight/ColorfulSoftlight.py +++ b/Code/Python_Code/09.1.1_ColorfulSoftlight/ColorfulSoftlight.py @@ -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 diff --git a/Code/Python_Code/10.1.1_Nightlamp/Nightlamp.py b/Code/Python_Code/10.1.1_Nightlamp/Nightlamp.py index 7d82006..55867f5 100644 --- a/Code/Python_Code/10.1.1_Nightlamp/Nightlamp.py +++ b/Code/Python_Code/10.1.1_Nightlamp/Nightlamp.py @@ -41,6 +41,7 @@ def loop(): def destroy(): adc.close() + p.stop() # stop PWM GPIO.cleanup() if __name__ == '__main__': # Program entrance diff --git a/Code/Python_Code/13.1.1_Motor/Motor.py b/Code/Python_Code/13.1.1_Motor/Motor.py index 8fef6c1..7343ea0 100644 --- a/Code/Python_Code/13.1.1_Motor/Motor.py +++ b/Code/Python_Code/13.1.1_Motor/Motor.py @@ -65,6 +65,7 @@ def loop(): time.sleep(0.01) def destroy(): + p.stop() # stop PWM GPIO.cleanup() if __name__ == '__main__': # Program entrance