Hello.
Is it possible, and how if it is to use TX0 and RX0 on ESP32 as secondary I2C SDA/SCL ?
TX0/RX0 is connected with Serial Monitor/IDE. Let us leave it there and configure some other pin-pair (any valid GPIO pin) to work as (soft?) I2C Bus Master. Currently, ESP8266 can't be operated as I2C Slave.
The inclusion of the following codes allows the ESP to work as I2C Bus master. All I2C Bus commands are valid.
#include<Wire.h>
Wire.begin(4, 5);//SDA, SCL = GPIO4, GPIO5
emh.. I dont have anymore free pins. Only the TX0 and RX0 left on my ESP32..
( it is not ES8266 . it is ESP32 )
So. TX0 and RX0 can not be used as GPIO at all ? only as TX and RX ?
Hello. Is it possible, and how if it is to use TX0 and RX0 on ESP32 as secondary I2C SDA/SCL ?
Did you try the format that is found if you do a Google search on;
ESP32 as secondary I2C SDA/SCL ?
@OP
In your sketch, you can configure GPIO1, GPIO3 as I2C Bus and use it to communicate with I2C devices. During uploading, these two IO pins wll be automatically working as UART pins. After uploading, disconnect the SM/IDE; press the RST button of the ESP32 and let the ESP's GPIO1, GPIO3 working as I2C Bus. (This is my thought.)
YorxY:
So. TX0 and RX0 can not be used as GPIO at all ? only as TX and RX ?
Why don't you try, quicker than waiting for an answer on here.
Write a simple program that reads say the TX0 pin and turns on an LED on the RX0 pin if TX0 is high or off if it low, does it work ?