M.V.P.
Published © MIT

Large Fonts for OLED 128x32 Driven by ATTiny85

DigiSpark ATtiny85 I2C connected to a tiny OLED (128x32 pixels) can show easily readable, huge fonts (16x32 pixels WxH)!

BeginnerShowcase (no instructions)1 hour10,957
Large Fonts for OLED 128x32 Driven by ATTiny85

Things used in this project

Hardware components

DigiSpark
DigiSpark
×1
Pmod OLED
Digilent Pmod OLED
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Schematic

Code

OLD Arduino Code. No longer updated.

Arduino
This is an example showing the use of digits and a few useful characters like , - . / and :
In this way a normal display of real numbers is possible.
/* Digispark ATtiny85 to small OLED 128x32 by I2C
 *  https://github.com/datacute/Tiny4kOLED 
 *  Tiny4kOLED.h: SSD1306xLED-Drivers for OLED 128x32 displays
 * @created: 2014-08-12  @author: Neven Boyanov
 * Source code available at: https://bitbucket.org/tinusaur/ssd1306xled
 * @ modified for 16x32 fonts: 2017-01-12 @author: M. V. Predoi 
 * Fits into Digispark  ATtiny85 (6012 bytes). 52 bytes of dynamic memory.
 *  ATtiny85   OLED
 *    <<------>>
 *  PB0        SDA
 *  PB2        SCL
 *  5V         VCC
 *  GND        GND
 *  
 */

#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
   //next line: oled.setCursor(X IN PIXELS, Y - NO EFFECT since 32 bits is max height);
  oled.setCursor(0, 0);
  oled.print(F("-23.56:/")); //wrap strings in F() to save RAM!
  delay(5000);    // To see the display "refresh"
}

Credits

M.V.P.

M.V.P.

7 projects • 46 followers
Arduino: Amazing, useful and rewarding hobby for some!

Comments