import time # need for the delay/sleep function
from machine import Pin
led = Pin(2,Pin.OUT) # LED is connected to Pin 2 of ESP32
while True:
led.value(1) # to turn the LED ON
time.sleep(0.5)
led.value(0) # to turn the LED OFF
time.sleep(0.5)