The simple way is to use the I2C.scan() method see: http://docs.micropython.org/en/latest/p ... b.I2C.scanorsisam wrote:Can You tell me how to find the i2c address using micropython?
Anyone working on HD44780 library?
Re: Anyone working on HD44780 library?
Re: Anyone working on HD44780 library?
How to use this function? I've tried but failed. I tried this codedhylands wrote:The simple way is to use the I2C.scan() method see: http://docs.micropython.org/en/latest/p ... b.I2C.scanorsisam wrote:Can You tell me how to find the i2c address using micropython?
Code: Select all
from machine import I2C
I2C.scan()
Code: Select all
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: function takes 1 positional arguments but 0 were given
-
- Posts: 463
- Joined: Wed Apr 08, 2015 5:19 am
Re: Anyone working on HD44780 library?
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.
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.
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: Anyone working on HD44780 library?
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.
Index to my micropython libraries.
Re: Anyone working on HD44780 library?
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
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
WeMos D1 Mini
WeMos Lolin32 v1.0.0
WeMos Lolin D32 Pro V2
Re: Anyone working on HD44780 library?
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,
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?
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
WeMos D1 Mini
WeMos Lolin32 v1.0.0
WeMos Lolin D32 Pro V2
Re: Anyone working on HD44780 library?
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.
Make sure you try the contrast pot full the other way as well.
Re: Anyone working on HD44780 library?
Worked perfect on NucleoF401RE as well, with below modifications in ..test.pydhylands wrote: ↑Tue Aug 05, 2014 6:10 amI 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:This was using today's build (just a regular build).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
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:Do you see a problem?Code: Select all
import pyb_gpio_lcd_test pyb_gpio_lcd_test.test_main()
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 )