Bucknalla/micropython-i2c-lcd

OSError: I2C bus error

Closed this issue · 8 comments

Natim commented

I tried to connect the RGB Backlight using your lib but I get an OSError.

I plugged it on VIN GND P21 and P22

image

Hi @Natim,

Could you please share the code you are trying to run?

Thanks,
Alex

Natim commented

Here is the code I am trying to run:

import i2c_lcd
from machine import I2C

i2c = I2C(0, I2C.MASTER)
d = i2c_lcd.Display(i2c)

d.home()
d.write('Hello World')

Could you please try running the code below in the MicroPython REPL:

from machine import I2C

i2c = I2C(0, I2C.MASTER)

print(i2c.scan())

It's likely that the LCD screen that you are using, uses a different I2C Address. This command should show you what addresses are available on the I2C bus.

Natim commented

I used to get back a table with [4, 6, 8, 62, 98, 112] but also sometimes an empty table.

Which LCD screen are you using - could you provide me a link to the specific device? It might be that the screen you are using has a different I2C address (62 == 0x3e, which is the expected address for the screen).

Can you also share your code and the OS Error that you get, please? This might help me determine where the error is occurring.

Another thought, are you sure that you are supplying 5V to the screen? You might need to use a logic level converter as the screen might be at 5V and the I2C bus at 3.3V

Natim commented

You are right it was because the VIN is -5V and not 5V.