Anyone working on HD44780 library?

Discuss development of drivers for external hardware and components, such as LCD screens, sensors, motor drivers, etc.
Target audience: Users and developers of drivers.
User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: Anyone working on HD44780 library?

Post by dhylands » Wed Sep 07, 2016 3:41 am

orsisam wrote:Can You tell me how to find the i2c address using micropython?
The simple way is to use the I2C.scan() method see: http://docs.micropython.org/en/latest/p ... b.I2C.scan

orsisam
Posts: 9
Joined: Mon Sep 05, 2016 5:58 pm

Re: Anyone working on HD44780 library?

Post by orsisam » Thu Sep 08, 2016 11:41 pm

dhylands wrote:
orsisam wrote:Can You tell me how to find the i2c address using micropython?
The simple way is to use the I2C.scan() method see: http://docs.micropython.org/en/latest/p ... b.I2C.scan
How to use this function? I've tried but failed. I tried this code

Code: Select all

from machine import I2C
I2C.scan()
but than I got this error messages

Code: Select all

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: function takes 1 positional arguments but 0 were given
So what argument should I give..?

SpotlightKid
Posts: 463
Joined: Wed Apr 08, 2015 5:19 am

Re: Anyone working on HD44780 library?

Post by SpotlightKid » Fri Sep 09, 2016 2:33 am

It's not a function, it's a method. So you need to create an Instance of the I2C class first and then call the scan method on that instance.

For the pyboard, see the example code at the top of the documentation page dhylands linked to. For the esp8266 portt see http://docs.micropython.org/en/latest/e ... e.I2C.html.

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Anyone working on HD44780 library?

Post by pythoncoder » Fri Sep 09, 2016 7:42 am

The point being that a microcontroller board can have multiple I2C interfaces: you have to create an instance on defined pins before you can scan it.
Peter Hinch
Index to my micropython libraries.

User avatar
patvdleer
Posts: 46
Joined: Mon Jun 13, 2016 11:52 am
Location: Maastricht, NL, Europe
Contact:

Re: Anyone working on HD44780 library?

Post by patvdleer » Fri May 19, 2017 3:49 pm

Any of you ever had the issues that the backlight on/off does work but nothing appears on the screen?

Although I bought it as a v3 but it looks light I got http://arduino-info.wikispaces.com/LCD-Blue-I2C#v1
NodeMCU v0.9 / V1 / V2 / V3
WeMos D1 Mini
WeMos Lolin32 v1.0.0
WeMos Lolin D32 Pro V2

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: Anyone working on HD44780 library?

Post by dhylands » Fri May 19, 2017 4:39 pm

The backlight is almost completely independent from the LCD.

Normally, when you power on the LCD you should see one row of black rectangles. If you're not seeing that, then you typically need to adjust the contrast voltage,

User avatar
patvdleer
Posts: 46
Joined: Mon Jun 13, 2016 11:52 am
Location: Maastricht, NL, Europe
Contact:

Re: Anyone working on HD44780 library?

Post by patvdleer » Fri May 19, 2017 5:39 pm

I do get something now but I still have to lay it almost completely flat just to see something, the blue potentiometer on the back is already fully open...
NodeMCU v0.9 / V1 / V2 / V3
WeMos D1 Mini
WeMos Lolin32 v1.0.0
WeMos Lolin D32 Pro V2

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: Anyone working on HD44780 library?

Post by dhylands » Fri May 19, 2017 6:50 pm

Are you powering the LCD with 3.3v? Or with 5v? The newer LCDs tend to work with both, but I wouldn't be surprised if there are some that need 5v to work properly.

Make sure you try the contrast pot full the other way as well.

User avatar
ta1db
Posts: 53
Joined: Mon Sep 02, 2019 12:05 pm
Contact:

Re: Anyone working on HD44780 library?

Post by ta1db » Tue Sep 17, 2019 5:40 pm

dhylands wrote:
Tue Aug 05, 2014 6:10 am
I occasionally get syntax errors on lines that are fine (although these may have been caused by this bug: https://github.com/micropython/micropython/issues/788 (on non-DEBUG builds it doesn't assert, it just corrupts some memory)

This seems to happen after doing a Control-D, and goes away if I hit the reset button.

Are you copying them to the /lib directory on the sdcard or the lib directory on the internal flash?

I tested on the internal flash, so I see:

Code: Select all

Micro Python v1.2-65-g6c70511 on 2014-08-04; PYBv1.0 with STM32F405RG
Type "help()" for more information.
>>> import os
>>> os.listdir('/flash/lib')
['lcd.py', 'pyb_gpio_lcd.py', 'pyb_gpio_lcd_test.py']
>>> import pyb_gpio_lcd_test
This was using today's build (just a regular build).

Perhaps try this:
- Build and flash the latest (do a make clean and then a make)
- Clear out the internal /flash (Mode 3 described here: http://micropython.org/doc/general)
- From the PC, create the lib directory
- copy lcd.py, pyb_gpio_lcd.py, and pyb_gpio_lcd_test.py to the lib directory
- Press the reset button
- Do:

Code: Select all

import pyb_gpio_lcd_test
pyb_gpio_lcd_test.test_main()
Do you see a problem?
Worked perfect on NucleoF401RE as well, with below modifications in ..test.py
Y12 -> D8
Y11 -> D9
Y5 -> D4
Y6 -> D5
Y7 -> D2
Y8 -> D7
num_lines=2, num_columns=16

thank you for your efforts. :|

ps. on the display board I have previously cut the D6 line and connected to D2 pin of Arduino connector therefore I made Y7 - > D2 instead of D6 ( but I don't remember the reason :) )

Post Reply