from machine import Pin
from time import sleep
RS = Pin(25,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)
push=Pin(12,Pin.IN,Pin.PULL_UP)
push2=Pin(13,Pin.IN,Pin.PULL_UP)
def LCD(x):
RS.value(int(x[8]))
D0.value(int(x[7]))
D1.value(int(x[6]))
D2.value(int(x[5]))
D3.value(int(x[4]))
D4.value(int(x[3]))
D5.value(int(x[2]))
D6.value(int(x[1]))
D7.value(int(x[0]))
En.on()
sleep(0.1)
En.off()
sleep(0.1)
#inicializacion
ini = ["001100000","001100000","001100000","001110000","000101000","000011000","000001100","000000010"]
fecha = ["001100001","001100111", "001011111", "001100011","001100001","001011111","001100101","001100111","000000010"]
ryzen= ["010100101", "011110011", "011110101", "011001011","011011101","000000010"]
intel= ["110000000","010010011","011011101","011101001","011001011","011011001","000000010"]
borrar=["000000010"]
for a in ini:
LCD(a)
while(1):
if push.value()==1 and push2.value()==1 :
for i in fecha:
LCD(i)
elif push.value()==1 and push2.value()==0:
for b in ryzen:
LCD(b)
elif push.value()==0 and push2.value()==1:
for c in intel:
LCD(c)
else:
for w in borrar:
LCD(w)