![Embarrassed :oops:](./images/smilies/icon_redface.gif)
It actually has 4x devices, each with 256k. [80,81,82,83].
My tests that were passing were to the onboard EEPROM, not the LC Tech module!
Code: Select all
# esp8266 -- eeprom
# 3v3 ------ vcc
# gnd ------ gnd
# D1 scl --- scl
# D2 sda --- sda
from machine import I2C, Pin
i2c = I2C(scl=Pin(5), sda=Pin(4), freq=400000)
i2c.scan()
# [80]
# does not work, addrsize defaults to 8.
i2c.writeto_mem(0x50, 0, b'hello world')
i2c.readfrom_mem(0x50, 0, 11)
# b'\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff'
# does work!
i2c.writeto_mem(0x50, 0, b'hello world', addrsize=16)
i2c.readfrom_mem(80, 0, 11, addrsize=16)
# b'hello world'
i2c.readfrom_mem(80, 2, 11, addrsize=16)
# b'llo world\xff\xff'