A little issue with the LCD 1602

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.

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?

Hi @Heikki_Hietala,

are there any news on the development side? Can you post a link to the modified version of the library?

Sorry, nothing yet. I found dhylands on Twitter and asked him to see my issue on Github, but he has not yet responded. I will post more when I get more.

I’ll post the contents of the files here. There are two files, lcdApi.py, and GpioLcd.py. The folder structure I use is

image
lcd libraries.zip (3.6 KB)

The main loop is:

# z\myLCD

from esp32_gpio_lcd import GpioLcd
import streams
streams.serial()

def main():
“”“Test function for verifying basic functionality.”""
print(“Running test_main”)
lcd = GpioLcd(rs_pin=4,
enable_pin=15,
d4_pin=17,
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
print(“in the loop”)

main()

I have a problem. When I try to uplink my code on my Esp32, the console show me this message: “No answer to probe”.

How could I resolve?

I resolved the problem of “No answer to probe” but now I have a problem regarding to the arguments of the initializer of GpioLcd. The console shows me this error: “Type Error”

hi @vinciuzz10 i have got your same problem “No answer to probe”. how do you resolve the error?
Thanks

Assuming you’re using Zerynth Studio 2 and an ESP32 (like vinciuzz10):

  • you should verifty that your board is correctly communicating via the serial port, first. [Click on the Device Information button on the top bar and check the “Port” row.]

If all seems okay, I would try to have ZS2 forget your device, then pair it again and redo the registration + virtualization.

Grazie Giancarlo, mi hai aiutato già ieri mattina, a lezione con il professore Greco, a risolvere il problema.

1 Like