When I run this code from the REPL:
>>> i2c = pyb.I2C(1, pyb.I2C.MASTER)
>>> i2c.mem_write(4, 90, 0x5e)
I get this error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: 16
I am trying to use the LCD buttons, and I have the LCD in correctly. Any help is appreciated.
OS Error 16
Re: OS Error 16
What does "i2c.scan()" say?
Re: OS Error 16
When I rundeshipu wrote:What does "i2c.scan()" say?
Code: Select all
i2c.scan
Code: Select all
[90]
Code: Select all
i2c.mem_write(4, 90, 0x5e)
Code: Select all
i2c.mem_read(1, 90, 0)[0]
Code: Select all
OSError: 116
Re: OS Error 16
It's hard to be sure without using a logic analyzer, but it looks like the device is responding with a NACK to your write request. Are you sure it's the right register you are trying to write to, and the right value? What is the device in question exactly? Do you have a datasheet for it? Do you have a small complete working snippet of code that demonstrates the issue?
Re: OS Error 16
I am using the standard LCD, and just following the tutorial, which can be found here: http://docs.micropython.org/en/latest/p ... _skin.html.