Today we are going to interface OLED SSD1306 with ATtiny85 microcontroller
Circuit Diagram
// Circuits DIY
// For Complete Details Visit -> https://circuits-diy.com
#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 World!");
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() {
}