from machine import Pin
import lcd
from time import sleep
# LCD pin setup
lcd_rs = Pin(14, Pin.OUT)
lcd_e = Pin(13, Pin.OUT)
lcd_d4 = Pin(12, Pin.OUT)
lcd_d5 = Pin(11, Pin.OUT)
lcd_d6 = Pin(10, Pin.OUT)
lcd_d7 = Pin(9, Pin.OUT)
lcd.init(lcd_rs, lcd_e, lcd_d4, lcd_d5, lcd_d6, lcd_d7)
lcd.clear()
# Name to scroll
name = "AKSHAJ"
while True:
# Scroll left to right
pos = 0
while pos <= 11:
lcd.clear()
lcd.setCursor(pos, 0)
lcd.print(name)
sleep(0.3)
pos = pos + 1
# Scroll right to left
pos = 10
while pos >= 0:
lcd.clear()
lcd.setCursor(pos, 0)
lcd.print(name)
sleep(0.3)
pos = pos - 1