OLED-Problem

Status
Not open for further replies.

Misterixx

Member
Hi there,
i have an Adafruit-OLED 128x64 and SSD1306 Controller connected to Teensy 3.6 via SPI

It works but the text at the screen ist too large because there always empty rows in the display, independently from textsize.
Connected at an Arduino mini pro, everything ist fine.
Can somebody help?
Here the Code:
#include <Wire.h>
#include <Adafruit_SSD1306.h>

//Adafruit_SSD1306 display(OLED_MOSI, OLED_CLK, OLED_DC, OLED_RESET, OLED_CS);
#define OLED_RESET 23
Adafruit_SSD1306 display(OLED_RESET);

void setup()
{
display.begin(SSD1306_SWITCHCAPVCC, 0x3D);
display.setTextSize(1);
display.setTextColor(WHITE);
display.setCursor(0, 0);
display.clearDisplay();
}


void loop()
{
while (1)
{
display.setTextSize(1);
display.setTextColor(WHITE);
display.setCursor(0, 0);
display.clearDisplay();
display.println("Zeile 1");
display.println("Zeile 2");
display.println("Zeile 3");
display.println("Zeile 4");
display.display();
delay(20000); // wait for a second
display.setTextSize(2);
display.setTextColor(WHITE);
display.setCursor(0, 0);
display.clearDisplay();
display.println("Zeile 1");
display.println("Zeile 2");
display.println("Zeile 3");
display.display();
delay(20000);
}
}

and picture:
IMG_5433.jpg


Thx,
Andreas
 
Your code is using println, to output the text. println - is setup to output a trailing CR/LF type output to setup to start text on the next line.
Try using print instead of println for the last line.
 
Hi, no thats not the problem.
In my case you can see in every letter are 6 black interspaces (missing pixel-rows). the result is: the letters are too large and i get only 4 rows of letters at the screen.
Same Code/Library at arduino mini pro with same Display: No black interspaces, more rows of letters at the screen (8?).
kind regards,
andreas
 
Are you sure that your compiler is really using the same library in both cases? It looks like the #defines for height and width of the display (which are normally done inside the library's .h file aren't correct. Please check the verbose output of the Arduino compiler window, the library paths are shown there. Odds are good that it takes a different variant when compiling for the Teensy. In that case, note the path and edit the display geometry #defines there, too.
 
Great!!!
always i changed th library in folder for arduino,
but there ia laos a library with same name in teensyduino-Folder! (C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries)
Now i changed the library für teensy with right display-dimensions and the display works fine!
Thx!!!
Andreas
 
Status
Not open for further replies.
Back
Top