Attiny84 and OLED 091 display

I am attempting to get the above to work together. Essentially I have copied the code from the mini weather station project. Using the following configuration:

IDE 2.2.1
AVR-ISP-MKII
OLED-091 128X32 high-resolution display

The code is:


/*
Test an ATTiny84 with an OLED displlay.
 */
//#include <TinyWireM.h>
//#include <USI_TWI_Master.h>
#include "SSD1306_minimal.h"
#include <avr/pgmspace.h>

#define DEG "\xa7" "C"

SSD1306_Mini oled; // Declare the OLED object

void splash() {
 oled.startScreen();
 oled.clear(); // Clears the display

 oled.cursorTo(0, 0); // x:0, y:0
 oled.printString("Hello");
 /*oled.cursorTo(0, 10); // x:0, y:23
 oled.printString("     ATtiny85!");
 oled.cursorTo(0, 20); // x:0, y:23
 oled.printString("   Circuits DIY");
 oled.cursorTo(0, 30); // x:0, y:23
 oled.printString("    JLCPCB.com"); */
}

void setup() {
 oled.init(0x3C); // Initializes the display to the specified address
 oled.clear(); // Clears the display
 delay(1000); // Delay for 1 second
 splash(); // Write something to the display (refer to the splash() method
}

void loop() {
}

Using the ATTinyCore by Spence Konde. Compiles and uploads without error. Nothing displays on the screen.

As far as I can determine the line

#define DEG "\xa7" "C"

defines the size of the display. This is not correct for my display but I am struggling o find any documentation of what exactly the lines does and how to set the correct display.

Please provide some pointers.

Recently I used the Tiny4kOLED library, with the same display you have, in combination with Attiny85. That worked well and I found it easy to use. It comes with a lot of example sketches.

At first glance this looks to be a great library. 10 minutes and it is working after a day of frustration! Thanks.

I recommend you also try the different I2C options in the I2CSpeedTest example sketch. You will see quite a difference in performance and compilation size depending on which I2C method you uncomment. Who knows you need that later in your project.

There are significant differences. As soon as I have the project up and running I will try a few options :slight_smile:

Update - I switched to tiny12c, very nice. All working 100%. Thanks for the pointers.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.