from machine import Pin
from time import sleep
import lcd
# Initialize LCD pins
lcd_rs = Pin(12, Pin.OUT)
lcd_e = Pin(11, Pin.OUT)
lcd_d4 = Pin(10, Pin.OUT)
lcd_d5 = Pin(9, Pin.OUT)
lcd_d6 = Pin(8, Pin.OUT)
lcd_d7 = Pin(7, Pin.OUT)
# LCD setup
lcd.init(lcd_rs, lcd_e, lcd_d4, lcd_d5, lcd_d6, lcd_d7)
while True:
lcd.clear()
lcd.setCursor(0, 0)
lcd.print("Loading...")
for i in range(16): # LCD has 16 columns
lcd.setCursor(i, 1) # Move to each column on the second row
lcd.print("|") # You can change this to "#" or "*"
sleep(0.2) #To pause
sleep(1) # Pause before restarting