Created
November 14, 2022 20:36
-
-
Save dewomser/0e9dc30a8b01fce02238f7108360f2fd to your computer and use it in GitHub Desktop.
Positive Flanke vom Schieberegister startet Barcodescanner
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import RPi.GPIO as GPIO | |
import subprocess | |
# import time | |
# import os | |
# adjust for where your switch is connected | |
buttonPin = 4 | |
GPIO.setmode(GPIO.BCM) | |
# GPIO.PUD_DOWN funktioniert nicht an pin 3 und 5 weil hardcoded ist UP | |
# GPIO.setup(buttonPin, GPIO.IN, GPIO.PUD_DOWN) | |
GPIO.setup(buttonPin, GPIO.IN, pull_up_down=GPIO.PUD_DOWN) | |
while True: | |
GPIO.wait_for_edge(buttonPin, GPIO.RISING) | |
# os.system("/home/karl/barcode.sh") | |
print(subprocess.run(["/home/karl/barcode.sh"], shell=True)) | |
GPIO.cleanup() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
typo