#---------One_Photo_Detector_test.py------------------------
#---------ECE 5725 Final Project----------------------------
#---------Create Date:2016/11/27 01:16----------------------

import RPi.GPIO as GPIO
import time

GPIO.cleanup()
GPIO.setmode(GPIO.BCM) # Set for broadcom numbering not board numbers

GPIO.setup(12, GPIO.IN, pull_up_down=GPIO.PUD_UP) #Receiving photo detector's signal in GPIO 12
GPIO.setup(13, GPIO.OUT) #GPIO 13 for lighting up the LED

while True:
time.sleep(0.2)
if ( not GPIO.input(12) ):
print(" ")
print "Signal received"
GPIO.output(13,1)
else:
print(" ")
print "No Signal received"
GPIO.output(13,0)