I2C Scanner example
Posted: Mon Aug 01, 2016 4:37 am
Just a quick & handy I2C scanner program that can help you with your I2C devices:
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
Code: Select all
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