Recently I purchased a Raspberry 3+ kit and working on a project using a light sensor and LED following instructions came with the kit.
The purpose of this project is to lit the LED when the light sensor senses less light.
The light sensor is working great on the test; the number in 'reading' goes up when it's dark, number goes down when it's bright.
However, the darkness wouldn't trigger LED to lit up.
Below is Fritzing and coding I'm using for the project. What needs to be fixed?

import RPi.GPIO as GPIO
import time
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
LED = 21
LS = 18
GPIO.setup(LED, GPIO.OUT)
def LSval(LSpin):
reading=0
GPIO.setup(LSpin, GPIO.OUT)
GPIO.output(LSpin, GPIO.LOW)
time.sleep(0.3)
GPIO.setup(LSpin, GPIO.IN)
while (GPIO.input(LSpin) == GPIO.LOW):
reading += 1
return reading
while True:
i = LSval(LS)
if LSval(LS) > 30000:
print('Dark', i)
GPIO.output(LED, True)
else:
print('Light', i)
GPIO.output(LED, False)