Skip to content

Arduino library for SSD1322 OLEDs with grayscale usability

License

Notifications You must be signed in to change notification settings

miwied/SSD1322_OLED_Arduino_library

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fork information

This is a fork from wjklimek1's repo, for more details check out his repo. This fork focuses on the compatibility with the Arduino framework (especially working with the ESP32 mcu).

Changes compared to the original repo:

  • Implemented Arduino compatibility
  • Translated files to cpp
  • Added wrapper class 'SSD1322.h' which holds and instances the 'sub-modules' correctly
  • Added an ESP32 example (PlatformIO project)
  • Deleted the STM32F4 Example


SSD1322 OLED Arduino library

Portable library for 256x64 OLED display with SSD1322 controller

Library is divided into three layers:

  • Hardware driver - contains all hardware dependent functions wrappers.
  • API - commands, initialization seqence, functions to change screen grayscale levels, color inversion, contrasct, etc. Uses only functions from hardware driver to send data to OLED.
  • GFX - functions to draw on frame buffer. Drawing single pixels, graphic primitives, lines, bitmaps and fonts. Operates only on frame buffer. Only function that sends buffer to OLED calls API funtions.

Adafruit fonts

GFX library can draw text with fonts provided by AdafruitGFX library. To write text with Adafruit font include font file and select font with function:

void select_font(const GFXfont *new_gfx_font)

for example:

select_font(&FreeMono12pt7b);

When font is already selected you can use it to write text on screen. It works only for null terminated strings!

Bitmaps

Two bitmap formats are supported:

void draw_bitmap_8bpp(uint8_t *frame_buffer, const uint8_t *bitmap, uint16_t x0, uint16_t y0, uint16_t x_size, uint16_t y_size);

It draws bitmap where one pixel corresponds to one byte - just an 8bit grayscale bitmaps.

void draw_bitmap_4bpp(uint8_t *frame_buffer, const uint8_t *bitmap, uint16_t x0, uint16_t y0, uint16_t x_size, uint16_t y_size);

Here one byte in bitmap stores brightness value for two pixels - just like in the actual framebuffer.

To convert bitmaps to 8 or 4 bits per pixel grayscale depth you can use converter from this link, downloading software "Converting bitmap to Hex". It's a bit buggy but worked for most bitmaps I tried to convert.

About

Arduino library for SSD1322 OLEDs with grayscale usability

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 92.7%
  • C++ 7.3%