from machine import Pin
from machine import UART
from utime import sleep
print("Hello, ESP32!")
led = Pin(15, Pin.OUT)
enble = Pin(34,Pin.IN)
swtch = Pin(35,Pin.IN)
uart = UART(2, baudrate=9600)
# lght = 0
while True:
led.off()
if enble.value() == 1:
if swtch.value() == 1:
#uart.write("Light On")
led.on()
# lght = 1
else:
#uart.write("Light off")
led.off()
else:
#uart.write("Light off")
led.off()
#sleep(5)
#Light 1 on ["0xFF","0x05","0x00","0x00","0xFF","0x00","0x99","0xE4"]
#Light 1 off ["0xFF","0x05","0x00","0x00","0x00","0x00","0xD8","0x14"]
#Light 2 on ["0xFF","0x05","0x00","0x01","0xFF","0x00","0xC8","0x24"]
#Light 2 off ["0xFF","0x05","0x00","0x01","0x00","0x00","0x89","0xD4"]
#Light 3 on ["0x01","0x05","0x00","0x00","0xFF","0x00","0x8C","0x3A"]
#Light 3 off ["0x01","0x05","0x00","0x00","0x00","0x00","0xCD","0xCA"]
#Light 4 on ["0x01","0x05","0x00","0x01","0xFF","0x00","0xDD","0xFA"]
#Light 4 off ["0x01","0x05","0x00","0x01","0x00","0x00","0x9C","0x0A"]