sound files

This commit is contained in:
tilman
2016-12-26 12:11:47 +01:00
parent 09394fb2ec
commit f089d125fe
6 changed files with 31 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
# piplayer2
# http://www.tilman.de/piplayer2
import RPi.GPIO as GPIO
import time
# photo sensor on PIN 17
GPIO.setmode(GPIO.BCM)
GPIO.setup(17, GPIO.IN)
# LED on PIN 27
GPIO.setup(27, GPIO.OUT)
GPIO.output(27, GPIO.LOW)
try:
print('Start sensor test')
while True:
time.sleep(0.25)
if (GPIO.input(17) == GPIO.LOW):
print('LOW')
GPIO.output(27, GPIO.LOW)
else:
print('HIGH')
GPIO.output(27, GPIO.HIGH)
except KeyboardInterrupt:
print('bye')
GPIO.cleanup()