Hello, I am new and noob here.
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
LED = 21
LS = 18
while (GPIO.input(LSpin) == GPIO.LOW):
reading += 1
i = LSval(LS)
if LSval(LS) > 30000: