Replies: 2 comments 8 replies
-
There most be more of an error message that just:
But it looks like an wiring error. In case that you use an Wemos D1 Mini: Edit: b.t.w.: Its an LCD, and you cannot write more that 2 x 16 characters. |
Beta Was this translation helpful? Give feedback.
-
Please try a scan on the I2C bus by calling:
That should return a short list of decimal numbers, which are the addresses of the devices on the bus. It should contain 39 == 0x27. If it shows no number or many, the I2C bus wiring is still wrong. If it shows a different number, you may have to use that address in your code. P.S.: To have a proper formatting of the code, include it in lines with three backticks ``` . As a shortcut you can select the code text and push Ctrl-E |
Beta Was this translation helpful? Give feedback.
-
Moin zusammen, ich habe folgendes Problem:
Ich versuche seit geraumer Zeit ein Display (GJD 1602IIC) an einen ESP8266 anzuschließen um mir (später) Seonsordaten anzeigen zu lassen.
Ich scheitere jedoch schon an der Installation.
Ich habe folgendes geschalten:
Anschluss SCL (Display) an D2 des ESP
Anschluss SDA (Display) an D1 des ESP
Anschluss GND (Display) an GND des ESP und
Anschluss VCC (Display) an 3V des ESP
Ich versuche, ein Python-Testprogramm in der Thonny-Umgebung zum Laufen zu bringen.
Hier der Code:
from time import sleep_ms, ticks_ms
from machine import I2C, Pin
from esp8266_i2c_lcd import I2cLcd
i2c = I2C(scl=Pin(5), sda=Pin(4), freq=400000)
lcd = I2cLcd(i2c, 0x27, 2, 16)
lcd.putstr("Hello ernitron\nIt's working!")
lcd.clear()
lcd.putstr("Using dhylands\npython_lcd")
lcd = I2cLcd(i2c, 0x27, 4, 20)
lcd.putstr("WeMos D1 Mini with PCF8574 I2C backpackWorks with HD44780s:08x2 16x1 16x2 20x4")
lcd.clear()
lcd.putstr("line 1\nline 2\nline 3\nline 4")
Starte ich das Programm erhalte ich folgende Fehlermeldung:
File "", line 7, in
File "/lib/esp8266_i2c_lcd.py", line 25, in init
In Zeile 25 steht: self.i2c.writeto(self.i2c_addr, bytearray([0]))
Leider kann ich damit nichts anfangen. Kann mir jemand helfen ?
Vielen Dank schon mal im Voraus.
LG Schalck`
Beta Was this translation helpful? Give feedback.
All reactions