Added destructor to disable buzzer at exit

This commit is contained in:
HerrNamenlos123 2021-01-15 22:55:52 +01:00
parent e571a7c97e
commit 71a3decedf

View file

@ -1,4 +1,5 @@
import RPi.GPIO as GPIO
import atexit
GPIO.setwarnings(False)
Buzzer_Pin = 17
@ -16,3 +17,8 @@ class Buzzer:
:return: None
"""
GPIO.output(Buzzer_Pin, on)
def exit():
Buzzer.set(0)
atexit.register(exit)