Qudio documentation

This commit is contained in:
2019-01-22 15:44:44 +01:00
parent 47cf97d488
commit df671e49f9
5 changed files with 43 additions and 26 deletions
+1 -1
View File
@@ -19,7 +19,7 @@ SOUND_SCANNING = "mnt/INTERNAL/sounds/scanning.mp3"
SOUND_SCAN_FAIL = "mnt/INTERNAL/sounds/fail-05.mp3"
QR_SCANNER_TIMEOUT = 4
# photo sensor on PIN 17
# photo sensor on PIN 5
PIN_SENSOR = 5
# LED on PIN 22
+2 -2
View File
@@ -2,7 +2,7 @@ import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setup(27,GPIO.OUT)
GPIO.output(27,GPIO.LOW)
GPIO.setup(22,GPIO.OUT)
GPIO.output(22,GPIO.LOW)
GPIO.cleanup()
+2 -2
View File
@@ -2,6 +2,6 @@ import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setup(27,GPIO.OUT)
GPIO.output(27,GPIO.HIGH)
GPIO.setup(22,GPIO.OUT)
GPIO.output(22,GPIO.HIGH)
+10 -10
View File
@@ -1,27 +1,27 @@
import RPi.GPIO as GPIO
import time
# photo sensor on PIN 17
# photo sensor on PIN 5
GPIO.setmode(GPIO.BCM)
GPIO.setup(17, GPIO.IN)
GPIO.setup(5, GPIO.IN)
# LED on PIN 27
GPIO.setup(27, GPIO.OUT)
GPIO.output(27, GPIO.LOW)
# LED on PIN 22
GPIO.setup(22, GPIO.OUT)
GPIO.output(22, GPIO.LOW)
try:
print('Start sensor test')
while True:
time.sleep(0.75)
if (GPIO.input(17) == GPIO.LOW):
time.sleep(0.5)
if (GPIO.input(5) == GPIO.LOW):
print('LOW')
GPIO.output(27, GPIO.LOW)
GPIO.output(22, GPIO.LOW)
else:
print('HIGH')
GPIO.output(27, GPIO.HIGH)
GPIO.output(22, GPIO.HIGH)
except KeyboardInterrupt:
print('KeyboardInterrupt')
GPIO.cleanup()
GPIO.cleanup()