[go: up one dir, main page]

Skip to content
This repository has been archived by the owner on Jan 18, 2023. It is now read-only.

C++ Library to support the I2C 128X64 OLED Display Module driven by the SSD1306 controller for the Raspberry pi SBC eco-system.

License

Notifications You must be signed in to change notification settings

tfkq/SSD1305_OLED_RPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

 OLED

Table of contents

Overview

  • Name : SSD1306_OLED_RPI
  • Description :
  1. Library to support the I2C 128X64 OLED Display Module driven by the SSD1306 controller for the Raspberry PI.
  2. Raspberry Pi C++ library.
  3. Inverse color, rotate, sleep, scroll and contrast control.
  4. Default font is Extended ASCII, scalable font.
  5. 4 other fonts included.
  6. Graphics class included.
  7. Bitmaps supported.
  8. Hardware I2C using bcm2835 library
  9. Also tested on 128X32 display size. Should work for 96X16 display size.

Installation

Install the C libraries of bcm2835, see: http://www.airspayce.com/mikem/bcm2835/ The bcm2835 is a dependency and provides I2C bus, delays and GPIO control. There are 7 different main.cpp in the examples folder copy the one to run into src folder "Hello world" is in src by default. Make sure to run test file with sudo

To Install and run "hello world" execute following commands:

curl -sL https://github.com/gavinlyonsrepo/SSD1306_OLED_RPI/archive/1.0.tar.gz | tar xz
cd SSD1306_OLED_RPI_1.0
make
sudo ./bin/test

Hardware

Connections as per manufacturers diagram, I2C bus pull-up resistors are on module. If 3.3V regulator on back of module can be powered from 5V PSU.

 wiring

Features

I2C

Hardware I2C. Settings are in the "OLED_I2C_ON" method.

  1. Address is set to 0x3C(your module could be different).
  2. Clock rate is to BCM2835_I2C_CLOCK_DIVIDER_626
    This can be increased if necessary to BCM2835_I2C_CLOCK_DIVIDER_148 for more faster bus. See bcm2835 for details

fonts

There are five fonts. A print class is available to print out most passed data types. The fonts 1-4 are byte high(at text size 1) scale-able fonts, columns of padding added by SW. Font 5 is special font large font but it is numbers only and cannot use the print class or be scaled(just one size).

Five fonts available :

Font num Font name Font size xbyy Note
1 Default 5x8 Full Extended ASCII 0 - 0xFF
2 Thick 7x8 no lowercase letters , ASCII 0x20 - 0x5A
3 Seven segment 4x8 ASCII 0x20 - 0x7A
4 Wide 8x8 no lowercase letters, ASCII 0x20 - 0x5A
5 Big Nums 16x32 ASCII 0x2E-0x3A ,Numbers + : . only

bitmaps

Bitmaps can be turned to data here at link use horizontal addressing draw mode. Use OLEDBitmap to draw bitmaps to buffer. You can also write a full screen bitmap direct to screen using OLEDBuffer method, this will use vertical addressing.

About

C++ Library to support the I2C 128X64 OLED Display Module driven by the SSD1306 controller for the Raspberry pi SBC eco-system.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 61.1%
  • C 35.2%
  • Makefile 3.7%