add motor class

This commit is contained in:
Konstantin Lampalzer 2021-01-15 18:22:50 +01:00
parent 5942c13721
commit b5a60438c0
No known key found for this signature in database
GPG key ID: 9A60A522835A2AD9
16 changed files with 438 additions and 100 deletions

23
oldLib/Buzzer.py Normal file
View file

@ -0,0 +1,23 @@
import time
import RPi.GPIO as GPIO
from Command import COMMAND as cmd
GPIO.setwarnings(False)
Buzzer_Pin = 17
GPIO.setmode(GPIO.BCM)
GPIO.setup(Buzzer_Pin, GPIO.OUT)
class Buzzer:
def run(self, command):
if command != "0":
GPIO.output(Buzzer_Pin, True)
else:
GPIO.output(Buzzer_Pin, False)
if __name__ == '__main__':
B = Buzzer()
B.run('1')
time.sleep(3)
B.run('0')