Hello all.
Got a Nano connected to a 128x32 OLED. I know they work, as I have used them many times before (I have them on my breadboards).
Simple connections, including 4k7 pullups to +5v
But.... refuses to work
Checked the address with I2C scanner and that is correct
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define OLED_RESET -1
Adafruit_SSD1306 display(128, 32, &Wire, OLED_RESET);
void setup() {
Serial.begin(9600);
Wire.begin();
if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {
Serial.println(F("SSD1306 allocation failed"));
for (;;);
}
//display.setTextWrap(false);
display.setTextColor(SSD1306_WHITE);
//display.setRotation(0);
display.clearDisplay();
display.drawRect(0, 0, 128, 32, SSD1306_WHITE);
//display.drawRect(16, 0, 96, display.height(), SSD1306_WHITE);
//display.setFont();
//display.setTextSize(1);
}
void loop() {
}
Sometimes it is the line Adafruit_SSD1306 display(128, 32, &Wire, OLED_RESET); Occasionally I have found this actually needs to be Adafruit_SSD1306 display(128, 64, &Wire, OLED_RESET);
But... nothing. Just a blank screen with dots.
Any ideas?
