diff --git a/compLIB/Buzzer.py b/compLIB/Buzzer.py index 2021301..67869dd 100644 --- a/compLIB/Buzzer.py +++ b/compLIB/Buzzer.py @@ -1,4 +1,5 @@ import RPi.GPIO as GPIO +import atexit GPIO.setwarnings(False) Buzzer_Pin = 17 @@ -15,4 +16,9 @@ class Buzzer: :param on: True if on, False if off :return: None """ - GPIO.output(Buzzer_Pin, on) \ No newline at end of file + GPIO.output(Buzzer_Pin, on) + +def exit(): + Buzzer.set(0) + +atexit.register(exit) \ No newline at end of file