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 X number here
pin_LED = Pin(15, Pin.OUT)
#####################################
###### MAIN ROUTINE
def main():
while True:
sleep(10)
print('just sleeping here')
#####################################
###### 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 every second (1,000 milliseconds)
myTimer.init(period=1000, mode=Timer.ONE_SHOT, callback=toggle_led)
#####################################
###### EXECUTE MAIN ROUTINE
if __name__ == '__main__':
main()