diff --git a/code/piplayer2.py b/code/piplayer2.py new file mode 100644 index 0000000..34dc502 --- /dev/null +++ b/code/piplayer2.py @@ -0,0 +1,26 @@ +import RPi.GPIO as GPIO +import time + +# photo sensor on PIN 4 +GPIO.setmode(GPIO.BCM) +GPIO.setup(4, GPIO.IN) + +# LED on PIN 17 +GPIO.setup(17, GPIO.OUT) +GPIO.output(17, GPIO.LOW) + +try: + print('Start sensor test') + + while True: + time.sleep(0.25) + if (GPIO.input(4) == GPIO.LOW): + print('LOW') + GPIO.output(17, GPIO.LOW) + else: + print('HIGH') + GPIO.output(17, GPIO.HIGH) + +except KeyboardInterrupt: + print('bye') + GPIO.cleanup() diff --git a/electronics/electronics.fzz b/electronics/electronics.fzz new file mode 100644 index 0000000..bd5fd1a Binary files /dev/null and b/electronics/electronics.fzz differ