Hi,
I have a ham radio transceiver project testing using a Mega with a 3.5 inch TFT display and a RTC.
I wanted to use a small 132 x 28 Oled display alongside to display various bits of info, but mostly as an 'S' meter reporting received signal strength. This already works within the main code to the 3.5 inch TFT
As it stands at the moment the code and TFT all work successfully.
Now I would like to use the oled display alongside this and am not sure if this is possible.
I bought an ebay .91 inch oled display for i2c with just 4 pins (no reset pin)
I loaded the Adafruit SSD1306 library. I set the line for SSD1306 i2c for 128x32 in the .h file.
I tested the display with the demo code and it all went swimmingly. Logo, text, graphics etc.
Now, in my code I had this amongst my includes ---
//############### OLED Display ###########
#include <Adafruit_SSD1306.h>
Adafruit_SSD1306 display(-1); // -1 = no reset pin
#define OLED_ADDR 0x3C // i2c address
and this in setup running first after Wire etc. ---
// OLED Setup and clear logo
display.begin(SSD1306_SWITCHCAPVCC, OLED_ADDR); // initialize with the I2C addr 0x3C (for the 128x32)
display.clearDisplay();
display.display();
display.setTextSize(1);
display.setTextColor(WHITE);
display.setCursor(10,20);
display.println("Hello, Rob!");
display.display();
However on loading the sketch all that happens is the display is blank. If I remove the display.clearDisplay(); then the logo is drawn but then nothing else happens on the oled display.
I tried a level shifter module but as it displays ok on the test program I don't think this is needed. It made no difference anyway.
I tried an i2c scan and the three devices used all have unique addresses.
I commented out the RTC stuff as I thought there may be a clash but no joy.
What am i missing here?
To me it seems if the logo and display clear work then the display should display the text ok.
Rob