Rename folder

This commit is contained in:
Konstantin Lampalzer 2021-01-16 02:10:40 +01:00
parent 651713c081
commit daef7c97e4
No known key found for this signature in database
GPG key ID: 9A60A522835A2AD9
11 changed files with 5 additions and 5 deletions

28
compLib/Buzzer.py Normal file
View file

@ -0,0 +1,28 @@
import atexit
import RPi.GPIO as GPIO
GPIO.setwarnings(False)
Buzzer_Pin = 17
GPIO.setmode(GPIO.BCM)
GPIO.setup(Buzzer_Pin, GPIO.OUT)
class Buzzer:
"""Used to interact with the buzzer
"""
@staticmethod
def set(on: bool):
"""Turn the buzzer on / off
:param on: True if on, False if off
"""
GPIO.output(Buzzer_Pin, on)
@staticmethod
def exit():
Buzzer.set(0)
atexit.register(Buzzer.exit)