@@ -0,0 +1,543 @@
+import RPi.GPIO as GPIO, time, os      %0A%0APIN_IN = 17 %0APIN_OUT = 18%0A%0ADEBUG = 1%0AGPIO.setmode(GPIO.BCM)%0AGPIO.setup(PIN_IN, GPIO.IN)%0AGPIO.setup(PIN_OUT, GPIO.OUT)%0A%0Adef isBright ():%0A  return GPIO.input(PIN_IN) == GPIO.LOW%0A%0AGPIO.output(PIN_OUT, GPIO.LOW)%0AlightOn = False%0A%0Awhile True:%0A  time.sleep(0.5)%0A  if isBright():%0A    if lightOn:%0A      print(%22It's day, turn off light%22)%0A      GPIO.output(PIN_OUT, GPIO.LOW)%0A      lightOn = False%0A  elif not lightOn:%0A    print(%22It's night, turn on light%22)%0A    GPIO.output(PIN_OUT, GPIO.HIGH) %0A    lightOn = True%0A

add photosensitive resistence sensor test code