from machine import Pin
from time import sleep

def lcd(x):
  D7.value(int(x[0]))
  D6.value(int(x[1]))
  D5.value(int(x[2]))
  D4.value(int(x[3]))
  D3.value(int(x[4]))
  D2.value(int(x[5]))
  D1.value(int(x[6]))
  D0.value(int(x[7]))
  RS.value(int(x[8]))
  En.on()
  sleep(.01)
  En.off()

RS=Pin(26,Pin.OUT)
En=Pin(23,Pin.OUT)
D0=Pin(22,Pin.OUT)
D1=Pin(21,Pin.OUT)
D2=Pin(19,Pin.OUT)
D3=Pin(18,Pin.OUT)
D4=Pin(5,Pin.OUT)
D5=Pin(4,Pin.OUT)
D6=Pin(2,Pin.OUT)
D7=Pin(15,Pin.OUT)

In=["001100000","001100000","001100000","001100000","000101000","000011000","000001100","000000010"]
Msj=["010101011","010100001","010001111","000000100"]

for i in In:
  lcd(i)

while(1):
  for i in Msj:
    lcd(i)