-->
Page 1 of 1

Esp-01 i2c

PostPosted: Wed May 17, 2017 8:02 am
by Philip Wellm
Hello forum,

as a project i tried to hook up an I2C Device to my esp8266.
We (accidently) ordered the ESP-01 Version where only 2 GPIO pins are available.

https://alselectro.files.wordpress.com/ ... =499&h=299

Enough i thought, but i tried to hook up my I2C device with

sda=0 -- connect to pin GPIO0
scl=2 -- connect to pin GPIO2

print(i2c.setup(id, sda, scl, i2c.SLOW))

and it sais "no i2c for D0"

am i missing something? is there a way to use the tx pin for i2c communication?

Re: Esp-01 i2c

PostPosted: Wed May 17, 2017 10:16 am
by marcelstoer
As for the wiring, does this help: http://www.forward.com.au/pfod/ESP8266/ ... magic.html (it's for Arduino but still).

Re: Esp-01 i2c

PostPosted: Wed May 17, 2017 2:05 pm
by 8n1
You are using the wrong pin numbers. 0 and 2 does not correlate to gpio 0 and gpio 2 resp.. See this: https://nodemcu.readthedocs.io/en/maste ... ules/gpio/