from machine import Pin
from utime import sleep
import random
ldr = Pin(27, Pin.IN)
# button = Pin(26, Pin.IN, Pin.PULL_UP) # Assuming the button is connected with a pull-up resistor
while True:
print("Hello")
if( ldr.value()):
value = random.randint(0,1)
print('value = {}'.format(value))
else:
print("LDR Not available")
sleep(3)