Error while retriving data

In my project automated light monitoring system , the error is occured…

Led is not glowing.
someone help me to solve the problem.
thanks in advance.

@sujithraa

There seems to be an issue with if condition where the code checks if the analogRead returns success value.

The value returned is an int while you are comparing it with a string. Please remove the single quotes around ‘1’. So your if condition will change to (ldr_data[‘success’] != 1):

1 Like

Thanks for your sugession…