Page 3 of 3

Re: Anyone working on HD44780 library?

Posted: Wed Sep 07, 2016 3:41 am
by dhylands
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

Re: Anyone working on HD44780 library?

Posted: Thu Sep 08, 2016 11:41 pm
by orsisam
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..?

Re: Anyone working on HD44780 library?

Posted: Fri Sep 09, 2016 2:33 am
by SpotlightKid
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.

Re: Anyone working on HD44780 library?

Posted: Fri Sep 09, 2016 7:42 am
by pythoncoder
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.

Re: Anyone working on HD44780 library?

Posted: Fri May 19, 2017 3:49 pm
by patvdleer
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

Re: Anyone working on HD44780 library?

Posted: Fri May 19, 2017 4:39 pm
by dhylands
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,

Re: Anyone working on HD44780 library?

Posted: Fri May 19, 2017 5:39 pm
by patvdleer
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...

Re: Anyone working on HD44780 library?

Posted: Fri May 19, 2017 6:50 pm
by dhylands
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.

Re: Anyone working on HD44780 library?

Posted: Tue Sep 17, 2019 5:40 pm
by ta1db
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 :) )