hello all,
i tested the oled spi using adafruit library. and it was working well and fine.
but after 1 week today, i ran the same code, oled isnt responding.
the code is verified without any error.
and oled is connected to mega 2560 on breadboard.
any inputs on the problem !
#define SCK 22
#define SDA 24
#define RESET 26
#define DC 28
#define CS 30
Adafruit_SSD1306 display(SDA, SCK, DC, RESET, CS);
void setup() {
//Setup internal VCC to supply voltage
display.begin(SSD1306_SWITCHCAPVCC);
// Display the Adafruit logo
display.display();
}
void loop() {
delay(1000);
display.clearDisplay();
// Draw a pixel at location (10,10)
display.drawPixel(10, 10, WHITE);
display.display();
delay(1000);
// Draw vertical and horizontal line from (0,0) and 100 pixels long with color white
display.drawFastVLine(0, 0, 100, WHITE);
display.drawFastHLine(0, 0, 100, WHITE);
delay(1000);
// Setup text size, color and display numbers and characters.
display.setTextSize(1);
display.setTextColor(WHITE);
display.setCursor(0,0);
for (uint8_t i='0'; i <= '9'; i++)
display.write(i);
display.println();
for (uint8_t i='A'; i <= 'Z'; i++)
display.write(i);
display.println();
for (uint8_t i='a'; i <= 'z'; i++)
display.write(i);
display.println();
display.display();
}