A little issue with the LCD 1602


#1

Hi again,

I think I’ve got the dhyland’s LCD library to work, since I can now build without errors, and my Main starts running. However, it doesn’t proceed past the LCD init stage, as below:

def main():
“”“Test function for verifying basic functionality.”""
print(“Running test_main”)
lcd = GpioLcd(rs_pin=4,
enable_pin=14,
d4_pin=5,
d5_pin=18,
d6_pin=21,
d7_pin=22,
num_lines=2, num_columns=16)
print(“lcd init done”)
lcd.putstr(“It Works!\nSecond Line”)
sleep(3000)
lcd.clear()
count = 0
while True:
lcd.move_to(0, 0)
lcd.putstr("%7d" % (MILLIS // 1000))
sleep(1000)
count += 1
main()

I see the “running test” part on serial, but not the “lcd init done”. For some reason it hangs before it, but I can’t figure out why.

In the definitions, it was said to wire the E (Enable) pin to ESP32’s D11, but I don’t see an 11, so I put it to 14 instead.

Any hints much appreciated,

-h.


#2

It must be the

lcd = GpioLcd(rs_pin=2,
              enable_pin=14,
              d4_pin=17,
              d5_pin=18,
              d6_pin=21,
              d7_pin=22,
              num_lines=2, num_columns=16)

part, because commenting that out lets the execution go forward. But the wires are connected to those pins.

Should I post the lcdapi.py and GpioLcd.py that I have modified?