I2C LCD Library... Help!
Re: I2C LCD Library... Help!
Hello,
I have the same problem.
My hardware:
-16x2 HD44780 Character LCD with IIC/I2C Serial Interface Adapter Module
-NodeMcu ESP8266 V3 (with the latest micropython firmware)
I can scan LCD on I2C.
>>> from machine import Pin, I2C
>>> i2c = I2C(scl=Pin(5), sda=Pin(4), freq=100000)
>>> i2c.scan()
[63]
Is there any way to write "Hello World" to LCD using I2C from NodeMCU?
Thanks.
I can't find I2C support for NodeMCU on https://github.com/dhylands/python_lcd
I have the same problem.
My hardware:
-16x2 HD44780 Character LCD with IIC/I2C Serial Interface Adapter Module
-NodeMcu ESP8266 V3 (with the latest micropython firmware)
I can scan LCD on I2C.
>>> from machine import Pin, I2C
>>> i2c = I2C(scl=Pin(5), sda=Pin(4), freq=100000)
>>> i2c.scan()
[63]
Is there any way to write "Hello World" to LCD using I2C from NodeMCU?
Thanks.
I can't find I2C support for NodeMCU on https://github.com/dhylands/python_lcd
Re: I2C LCD Library... Help!
I guess we need to establish which i2c backpack you're using (there are quite a few).
None of the ones I've used have an address of 63?
If you disconnect the LCD and repeat the scan does 63 still show up?
None of the ones I've used have an address of 63?
If you disconnect the LCD and repeat the scan does 63 still show up?
Re: I2C LCD Library... Help!
raspi3ua, did you try the code (esp8266_i2c_lcd.py and lcd.py) that i have posted on this thread on Sat Oct 01, 2016 2:36 am?
NodeMCU is basically an esp8266 board so the code shall work.
When using the two files mentioned above, you could try something like this (adjust the pins to your setup) :
But like dhylands said, 0x63 seems odd for an I2C LCD backpack address.
NodeMCU is basically an esp8266 board so the code shall work.
When using the two files mentioned above, you could try something like this (adjust the pins to your setup) :
Code: Select all
from machine import Pin, I2C
from esp8266_i2c_lcd import I2cLcd
i2c = I2C(scl=Pin(5), sda=Pin(4), freq=100000)
lcd = I2cLcd(i2c, 0x63, 2, 16)
lcd.clear()
lcd.putstr('Hello World!')
Re: I2C LCD Library... Help!
Note that i2c.scan reports addresses in decimal so 63 = 0x3F not 0x63
Re: I2C LCD Library... Help!
Oh yeah! i've missed that one
Re: I2C LCD Library... Help!
[quote="dhylands"] I guess we need to establish which i2c backpack you're using (there are quite a few).
None of the ones I've used have an address of 63?
If you disconnect the LCD and repeat the scan does 63 still show up? [/quote]
My hardware is from Aliexpress This one:
https://www.aliexpress.com/item/1602-16 ... 0.0.CZ7EC3
https://www.aliexpress.com/item/V3-4M-b ... 0.0.CZ7EC3
I disconnect LCD and scan. Same number 63
>>> i2c.scan()
[63]
None of the ones I've used have an address of 63?
If you disconnect the LCD and repeat the scan does 63 still show up? [/quote]
My hardware is from Aliexpress This one:
https://www.aliexpress.com/item/1602-16 ... 0.0.CZ7EC3
https://www.aliexpress.com/item/V3-4M-b ... 0.0.CZ7EC3
I disconnect LCD and scan. Same number 63
>>> i2c.scan()
[63]
Re: I2C LCD Library... Help!
I can read numbers on I2C Backpack chip: "PCF8574AT L21521"
I think this one https://www.nxp.com/documents/data_sheet/PCF8574.pdf
I think this one https://www.nxp.com/documents/data_sheet/PCF8574.pdf
Last edited by raspi3ua on Sat Mar 18, 2017 8:40 pm, edited 1 time in total.
Re: I2C LCD Library... Help!
Connect NodeMCU ->I2C Backpack ->LCDsequel wrote:raspi3ua, did you try the code (esp8266_i2c_lcd.py and lcd.py) that i have posted on this thread on Sat Oct 01, 2016 2:36 am?
NodeMCU is basically an esp8266 board so the code shall work.
All LCD is white.
>>> from esp8266_i2c_lcd import I2cLcd
>>> from machine import Pin, I2C
>>> i2c = I2C(scl=Pin(5), sda=Pin(4), freq=100000)
>>> lcd = I2cLcd(i2c, 63, 2, 16) <--- Just LCD blink
>>> lcd.clear() <--- nothing
>>> lcd.putstr('Hello World!') <--- nothing
>>> i2c.scan()
[63]
>>> lcd = I2cLcd(i2c, 0x63, 2, 16)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "esp8266_i2c_lcd.py", line 26, in __init__
OSError: [Errno 19] ENODEV
>>> lcd = I2cLcd(i2c, 0x3F, 2, 16) <--- Just LCD blink
>>> i2c.writeto(63, '1') <--- All LCD is black now
1
>>> i2c.writeto(63, '8') <--- All LCD is while now
1
Re: I2C LCD Library... Help!
That tells me that your device isn't being seen by the scan then. Check to make sure you haven't swapped SDA and SCL. Also make sure that vcc and ground are hooked up.raspi3ua wrote:My hardware is from Aliexpress This one:dhylands wrote: I guess we need to establish which i2c backpack you're using (there are quite a few).
None of the ones I've used have an address of 63?
If you disconnect the LCD and repeat the scan does 63 still show up?
https://www.aliexpress.com/item/1602-16 ... 0.0.CZ7EC3
https://www.aliexpress.com/item/V3-4M-b ... 0.0.CZ7EC3
I disconnect LCD and scan. Same number 63
>>> i2c.scan()
[63]
The PCF8574 has an I2C address of 0x20 thru 0x27 (32 thru 39). Device 63 is something else on the i2c bus and not your LCD backpack.
Re: I2C LCD Library... Help!
Very strange. Tried to swap SDA and SCL, tried to change cables, tried to disconnect any cable - always results []dhylands wrote:That tells me that your device isn't being seen by the scan then. Check to make sure you haven't swapped SDA and SCL. Also make sure that vcc and ground are hooked up.
The PCF8574 has an I2C address of 0x20 thru 0x27 (32 thru 39). Device 63 is something else on the i2c bus and not your LCD backpack.
>>> i2c.scan()
[]
>>> i2c.scan()
[]
>>> i2c.scan()
[]
>>> i2c.scan()
[]
>>> i2c.scan()
[63]
>>> i2c.scan()
[]
>>> i2c.scan()
[]
>>> i2c.scan()
[]
I have 63 when pins connected like this:
https://www.losant.com/hs-fs/hubfs/Blog ... wiring.jpg