I bought an Oled screen mini (0.66 inch 64x48 pixels) and I want to display "Hello World" on the screen.
I used Arduino Mega , I connected the pins of screen D1 -> SCL and D2 -> SDA and Rst -> 2,but the screen doesn't work or displays any thing (just black screen).
This is the code
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define OLED_RESET 2
Adafruit_SSD1306 display(OLED_RESET);
#define NUMFLAKES 10
#define XPOS 0
#define YPOS 1
#define DELTAY 2
#define LOGO16_GLCD_HEIGHT 16
#define LOGO16_GLCD_WIDTH 16
void setup() {
Serial.begin(9600);
// by default, we'll generate the high voltage from the 3.3v line internally! (neat!)
display.begin(SSD1306_SWITCHCAPVCC, 0x3C); // initialize with the I2C addr 0x3C (for the 64x48)
// init done
display.display();
delay(2000);
// Clear the buffer.
display.clearDisplay();
// text display tests
display.setTextSize(1);
display.setTextColor(WHITE);
display.setCursor(0,0);
display.println("Hello, world!");
display.display();
delay(2000);
display.clearDisplay();
}
void loop() {
}
This is the Link of my Oled screen from ebay:
https://www.ebay.fr/itm/OLED-Mini-0-66-Inch-Display-LCD-Module-IIC-I2C-Bouclier-Pour-WeMos-D1/164361920661?hash=item2644bbe095:g:LtMAAOSwyR1eNbpQ&var=463974334515
Can you help me,please?
Thank you.