I’ve been attempting to use an I2C display with some buttons on my ESP32-S3-DevkitC-1. I was able to get the ESP-32 working with Platformio but I haven’t been able to find the I2C pins on the ESP32 in all pinouts I could find, there were no pins that were specifically for I2C. I read that pins could be programmed to act as the I2C pins but I couldn’t find any specific commands to do so.
Here is the code I have been working with to check any devices that are connected to I2C
#include <Arduino.h>
#include <Wire.h>
void setup() {
Serial.begin (115200);
Serial.println ("I2C scanner. Scanning ...");
byte count = 0;
// 0x27 0x3F
Wire.begin();
for (byte i = 8; i < 120; i++)
{
Wire.beginTransmission (i);
if (Wire.endTransmission () == 0)
{
Serial.print ("Found address: ");
Serial.print (i, DEC);
Serial.print (" (0x");
Serial.print (i, HEX);
Serial.println (")");
count++;
delay (1);
}
}
Serial.println ("Done.");
Serial.print ("Found ");
Serial.print (count, DEC);
Serial.println (" device(s).");
} // end of setup
void loop() {}