[SOLVED] Help with ATTINY85 and 0.96" OLED display.

Thread Starter

KeithWalker

Joined Jul 10, 2017
2,026
I have successfully programmed a ATTINY85 to display characters on a 0.96", 128x64 OLED display but the characters (8x6) are so small they are almost unreadable. I have searched the internet and tried all the examples that I can find that supposedly display larger characters but they either do not compile for the TINY85 or they give error messages for the added libraries. I have tried using different versions of the Arduino IDE, right up to the latest.
Has anyone managed to display characters larger than 8x6 pixels? I don't need the full alphabet. I can make do with numbers 0 - 9, with maybe one added custom character. I only need one line of characters, so I could use the 0.9" 128x32 OLED if necessary.
I would really appreciate any help I can get.
 

click_here

Joined Sep 22, 2020
446
You've got 2 choices: Try to fix the errors in your library, or make your own library.

If I were you I'd make a copy of the library (so any changes won't bin the original code), name the library "my_..." and the try and fault find the bugs.
 

MrChips

Joined Oct 2, 2009
24,592
If no one else steps up I can lend a hand.
I would need to know what IDE platform you are using.
Then I need the part number of the display, the datasheet, and how it is interfaced to the display. My intent would be to create my own character font to suit your requirements.
 

Thread Starter

KeithWalker

Joined Jul 10, 2017
2,026
Use the adafruit library. You'll have to install the GFX primitive library first. Then the adafruit-greyOLED library.
this library has large and small fonts, shapes, more.
Then then Adafruit_SSD1306 library (SSD1306 is the chip in these little OLED displays).

here is the sample splash code...
https://github.com/adafruit/Adafrui...les/ssd1306_128x64_i2c/ssd1306_128x64_i2c.ino
This really doesn't help much. The Tiny85 only has 30.62 K of memory. I have used the SSD1306 and the U8g2 libraries quite a successfully with the ATmega328 but these graphics and character libraries are far to large to fit into the TINY85
The SSD1306-minimal library and the U8x8 library both work but they only have characters 8 pixels high.
 

Thread Starter

KeithWalker

Joined Jul 10, 2017
2,026
You've got 2 choices: Try to fix the errors in your library, or make your own library.

If I were you I'd make a copy of the library (so any changes won't bin the original code), name the library "my_..." and the try and fault find the bugs.
It looks as though I will have to try to fix one of the libraries that is giving me errors. I will try to fix the Tiny4kOLED library. It doesn't recognize the command "oled.setFont(FONT16X32)". This is the example I am trying to get working:

//OLED Large Fonts

#include <Tiny4kOLED.h>
#include <TinyWireM.h>

void setup() {

oled.begin();
oled.clear();
oled.on();

}
void loop() {

oled.clear(); //all black
oled.setFont(FONT16X32); // 1 raw of 8 characters exactly fills 128x32
oled.setCursor(0, 0);
oled.print(F("-23.56:/")); //wrap strings in F() to save RAM!
delay(5000); // To see the display "refresh"
}
 

click_here

Joined Sep 22, 2020
446
Or maybe calling this function
(From here)
Code:
void doubleSize() {
  oled.setFont(FONT6X8P);
  oled.setCursor(0, 2);
  oled.printDoubleSize(F("Double Size"));

  oled.setFont(FONT8X16P);
  oled.setCursor(0, 4);
  oled.printDoubleSize(F("Datacute"));
}
 

Thread Starter

KeithWalker

Joined Jul 10, 2017
2,026
Problem solved!
I had tried so many different examples that didn't work that I ended up with an non-functional copy of Tiny4kOLED library in my working folder as well as a good copy in the library folder. The compiler was using the bad one. Thank you all for your help and suggestions. Now the DoubleSizeText example in the Tiny4kOLED library works.
I am very happy that I can finish the project that I started.
:)
 

Thread Starter

KeithWalker

Joined Jul 10, 2017
2,026
Now it is working, I have discovered that the Double Text size in Tiny4kOLED does not print variables but the normal sized text will print variables with 8 x 16 characters which is a considerable improvement over what I had.
 
Top