"""Implements a HD44780 character LCD connected via ESP32 GPIO pins."""
from machine import Pin
from esp32_gpio_lcd import GpioLcd
from utime import sleep_ms, ticks_ms
def test_main():
"""Test function for verifying basic functionality."""
print("Running test_main")
lcd = GpioLcd(rs_pin=Pin(4),
enable_pin=Pin(15),
d4_pin=Pin(5),
d5_pin=Pin(18),
d6_pin=Pin(21),
d7_pin=Pin(22),
num_lines=2, num_columns=20)
lcd.putstr("It Works!\nSecond Line\nThird Line\nFourth Line")
sleep_ms(1000)
lcd.clear()
count = 0
while True:
lcd.move_to(2, 0) #el primero se mueve en la posición de col el segundo en filas
#lcd.putstr("%5d" % (count))#cantidad de espacios a dejar como ref
lcd.putstr(str(count))
count += 1
test_main()