Hi there,
I'm new to using the ESP01S and I'm trying to connect a 0.91 inch 128x32 OLED SSD1306 screen to it. I know how to connect the screen to an Arduino Nano and how to display text using the "u8g2" library, here's the code I use:
#include <Arduino.h>
#include <U8g2lib.h>
#ifdef U8X8_HAVE_HW_SPI
#include <SPI.h>
#endif
#ifdef U8X8_HAVE_HW_I2C
#include <Wire.h>
#endif
U8G2_SSD1306_128X32_UNIVISION_F_SW_I2C u8g2(U8G2_R0, /* clock=*/ SCL, /* data=*/ SDA, /* reset=*/ U8X8_PIN_NONE); // Adafruit Feather ESP8266/32u4 Boards + FeatherWing OLED
void setup(void) {
u8g2.begin();
}
void loop(void) {
u8g2.clearBuffer(); // clear the internal memory
u8g2.setFont(u8g2_font_ncenB08_tr); // choose a suitable font
u8g2.drawStr(0,10,"Hello World!"); // write something to the internal memory
u8g2.sendBuffer(); // transfer internal memory to the display
delay(1000);
}
But I'm not sure if that library is compatible with the ESP01S or if there is a better library to use. Any suggestions, diagrams or examples of working code would be appreciated.
Connected screen like this - VCC to 5V (from Arduino Nano), GND to GND (also Nano), IO0 to SLC (SCK in my case) and IO2 to SDA
clock is SCL and data is SDA, so I don't know why it's not working