print("Hello, ESP32!")
#####################################
###### IMPORT LIBRARIES
from machine import Pin, Timer
from utime import sleep
#####################################
###### PIN CONFIGURATIONS
# Configure the pin as output
# Replace the x with your GPIO Pin number here
pin_led = Pin(23, Pin.OUT)
#####################################
###### SUBROUTINE FOR TIMER
# Create an uninitialized timer object
myTimer = Timer(1)
# Create a function to be called when the timer goes off
# This function just toggles the onboard LED
def toggle_led(myTimer):
pin_led.on()
sleep(0.5)
pin_led.off()
sleep(0.5)
# Initialize the timer object to tick 10 times per second (every 100 ms)
myTimer.init(freq=10, mode=Timer.PERIODIC, callback=toggle_led)
#####################################
###### MAIN ROUTINE
def main():
while True:
sleep(10)
# continue loop
#####################################
###### EXECUTE MAIN ROUTINE
if __name__ == '__main__':
main()