for address = 1 to 127
i2c.begin(address)
stat = i2c.end()
if stat < 1 then
' print stat
wprint "Found I2C device at address: 0x" & hex(address)
wprint " - > " & address
wprint " <br>"
endif
next
wait
Please keep in mind that in ESP Basic you have hardcoded I2C pins yet, SDA -> GPIO0 and SCL -> GPIO2.
Don't forget to add if needed pullup resistors on both lines, 4K7 should be OK.
Original Article with pictures & stuff: ESP Basic I2C scanner example
Available on Tindie: https://www.tindie.com/products/nEXT_EVO1/universal-ac-mains-dimmer-mpdmv41/