{"id":19856570,"url":"https://github.com/gavinlyonsrepo/er_oledm1_ch1115","last_synced_at":"2025-05-02T01:31:37.110Z","repository":{"id":98596903,"uuid":"362765523","full_name":"gavinlyonsrepo/ER_OLEDM1_CH1115","owner":"gavinlyonsrepo","description":"Library to support the ER-OLEDM1.09-1 128X64 OLED Display Module driven by the CH1115 controller for the Arduino eco-system. SPI. ","archived":false,"fork":false,"pushed_at":"2025-01-19T21:49:25.000Z","size":599,"stargazers_count":6,"open_issues_count":0,"forks_count":4,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-06T20:51:16.569Z","etag":null,"topics":["128x64","128x64oled","arduino","arduino-ide","arduino-lib","arduino-library","ascii-font","ch1115","display","er-oledm1","ermoledm1","esp32","esp8266","library","multi-buffer","oled","spi","stm32","stm32f103c8t6"],"latest_commit_sha":null,"homepage":"https://gavinlyonsrepo.github.io/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gavinlyonsrepo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-04-29T09:40:18.000Z","updated_at":"2025-01-19T21:49:27.000Z","dependencies_parsed_at":"2024-02-09T20:25:44.360Z","dependency_job_id":"78e43c5c-4a79-4c9a-b814-d6c96e19bcfa","html_url":"https://github.com/gavinlyonsrepo/ER_OLEDM1_CH1115","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gavinlyonsrepo%2FER_OLEDM1_CH1115","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gavinlyonsrepo%2FER_OLEDM1_CH1115/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gavinlyonsrepo%2FER_OLEDM1_CH1115/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gavinlyonsrepo%2FER_OLEDM1_CH1115/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gavinlyonsrepo","download_url":"https://codeload.github.com/gavinlyonsrepo/ER_OLEDM1_CH1115/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251969432,"owners_count":21673203,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["128x64","128x64oled","arduino","arduino-ide","arduino-lib","arduino-library","ascii-font","ch1115","display","er-oledm1","ermoledm1","esp32","esp8266","library","multi-buffer","oled","spi","stm32","stm32f103c8t6"],"created_at":"2024-11-12T14:16:00.142Z","updated_at":"2025-05-02T01:31:37.102Z","avatar_url":"https://github.com/gavinlyonsrepo.png","language":"C++","funding_links":["https://www.paypal.com/paypalme/whitelight976"],"categories":[],"sub_categories":[],"readme":"[![Website](https://img.shields.io/badge/Website-Link-blue.svg)](https://gavinlyonsrepo.github.io/)  [![Rss](https://img.shields.io/badge/Subscribe-RSS-yellow.svg)](https://gavinlyonsrepo.github.io//feed.xml)  [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/paypalme/whitelight976)\n\n![url OLED image ](https://github.com/gavinlyonsrepo/ER_OLEDM1_CH1115/blob/main/extras/image/oled.jpg)\n\n# ER_OLEDM1_CH1115\n\n## Table of contents\n\n\n  * [Overview](#overview)\n  * [Output](#output)\n  * [Installation](#installation)\n  * [Hardware](#hardware)\n  * [Software](#software)\n\t* [API documentation](#api-documentation)\n\t* [SPI](#spi)\n\t* [Buffer](#buffer)\n\t* [Fonts](#fonts)\n\t* [Bitmaps](#bitmaps)\n\t* [User adjustments](#user-adjustments)\n\t* [Files](#files)\n  * [Tested_MCU](#tested_MCU)\n\n## Overview\n\n* Name : ER_OLEDM1_CH1115\n* Title : Library to support the ER-OLEDM1.09-1  OLED Display Module driven by the CH1115 controller for the Arduino eco-system.\n* Description : \n\n1. Arduino eco-system library.      \n2. Invert colour, vertical rotate, sleep, fade effect, horizontal scroll and contrast control  functions supported.\n3. 12 ASCII fonts included.\n4. Graphics support included.\n5. Multi Screen, single shared buffer mode.\n6. Bitmaps supported.\n7. Hardware \u0026 software SPI options\n\n* Author: Gavin Lyons\n\n* Light weight basic text version  [here at link.](https://github.com/gavinlyonsrepo/ER_OLEDM1_CH1115_TEXT).\n\n\n## Output\n\nOutput Screenshots, From left to right, top to bottom.\n\n1. Full screen bitmap displayed \n2. Shared Screen mode, screen divided into two Screens with one buffer, Frame rate per second demo.\n3. Shared Screen mode, screen divided into two Screens with one buffer, clock demo.\n4. Different size and type of fonts \n5. Available ASCII font printed out 0-127\n6. Extended ASCII font printed out 128-255  \n7. Font 1-4 \n8. Font 7\n\n![ url output image ](https://github.com/gavinlyonsrepo/ER_OLEDM1_CH1115/blob/main/extras/image/output.jpg)\n![ url output image 2 ](https://github.com/gavinlyonsrepo/ER_OLEDM1_CH1115/blob/main/extras/image/fontpic.jpg)\n\n## Installation\n\nThe library is included in the official Arduino library manger and the optimum way to install it is \nusing the library manager which can be opened by the *manage libraries* option in Arduino IDE. \n\n## Hardware\n\nCH1115 is a single-chip CMOS OLED driver with controller for organic light emitting diode dot-matrix graphic display system. CH1115 consists of 128 segments, 64 commons that can support a maximum display resolution of 128 X 64. It is designed for Common Cathode type OLED panel. ER-OLEDM1.09-1W-SPI is a White 1.09\" OLED Display Panel with Breakout Board. This module is a combination of the two.(controller and OLED)\n\n| pin no  | pin name | pin desc |\n|---|---|---|\n| 1 | Gnd | Ground |\n| 2 | VCC | voltage supply |\n| 3 | SCL | Serial clock input |\n| 4 | SDA | Serial data input |\n| 5 | RES | This pin is reset signal input. When the pin is low, initialization of the chip is executed. |\n| 6 | DC | This pin is Data or Command control pin. |\n| 7 | CS | This pin is chip select input. The chip is enabled for MCU comms  when CS is pulled low|\n\n**VCC**\nThe CH1115 controller chip is a 3.3V device but the ERM LCD module has a \"662k\" 3.3V regulator at back. So the ERM OLED module VCC will also run at 5V. \n\n**Logic lines**\nThe logic lines where always connected to 3.3 Volts logic during all testing of library.\n The system can also run at 5 volts logic, the manufacture has instructional videos connected to \n an  Arduino Mega. \n \n This wiring Diagram from the manufacturer datasheet showing hardware setup connected to a 3.3 volt system MCU.\n\n![ url wiring  image ](https://github.com/gavinlyonsrepo/ER_OLEDM1_CH1115/blob/main/extras/image/wiring.jpg)\n\n## Software\n\n\n### API documentation\n\nThe API (application programming interface) documentation is at link hosted on github pages and generated by Doxygen. \n\n[API  URL](https://gavinlyonsrepo.github.io/misc/software_docs/ER_OLEDM1_CH1115/index.html)\n\n### SPI\n\nHardware and software SPI. Two different class constructors. User can pick the relevant constructor, see examples files. Hardware SPI is recommended, far faster and more reliable but Software SPI allows for more flexible GPIO selection. When running Software SPI it may be necessary on very fast high frequency MCU's to change the ERMCH1115_HIGHFREQ_DELAY define, It is a microsecond delay by default it is at 0. All the hardware SPI settings are defined in the header file and can be easily changed if necessary. \n\n### Buffer\n\nThe library features a multi-screen shared buffer mode, In order to save data memory.\n\nFor example if user defines a buffer to cover the whole screen it takes 1024 bytes of data memory. Instead a user can create a buffer that covers half the screen for just 512 bytes then define two screens each pointing to the same buffer.\nThe user uses the ERMCH1115_SharedBuffer Class objects to define each screen\nand the ActiveBufferPtr pointer to switch between each screen. Multiple screens of same size can be created so OLED screen can be divided into thirds or quarters saving even more memory.\nThe disadvantage of this is the code is slightly more complicated and user can only write to one screen at a time. If user does not want to use multi screen mode they can simply just define ONE screen to cover entire OLED screen. See example files for more detail.\n\n### Fonts\n\nFont data table:\n\n| num | enum name | Char size XbyY | ASCII range | Size bytes | Size Scale-able |\n| ------ | ------ | ------ | ------ |  ------ | ----- |\n| 1 | $_Default | 5x8 |0-0x7F|635 |Y|\n| 2 | $_Thick   | 7x8 |0x20-0x5A, no lowercase letters |406|Y|\n| 3 | $_SevenSeg  | 4x8 |0x20-0x7A |360|Y|\n| 4 | $_Wide | 8x8 |0x20-0x5A, no lowercase letters|464|Y|\n| 5 | $_Tiny | 3x8 |0x20-0x7E |285|Y|\n| 6 | $_Homespun  | 7x8 |0x20-0x7E |658|Y|\n| 7 | $_Bignum | 16x32 |0x2D-0x3A ,0-10 - . / : |896|N|\n| 8 | $_Mednum | 16x16 |0x2D-0x3A ,0-10 - . / :|448|N|\n| 9 | $_ArialRound| 16x24 | 0x20-0x7E |4608|N|\n| 10 | $_ArialBold | 16x16 |0x20-0x7E |3072|N|\n| 11 | $_Mia| 8x16 | 0x20-0x7E |1520|N|\n| 12 | $_Dedica | 6x12 |0x20-0x7E |1152|N|\n\n1. $ = CH1115Font\n2. Fonts 1-6 are byte high(at text size 1) scale-able fonts, columns of padding added by SW.\n3. Font 7-8 are large numerical fonts and cannot be scaled(just one size).\n4. Fonts 9-12 Alphanumeric fonts and cannot be scaled(just one size)\n\nFont Methods:\n\n| Font num | Method | Size parameter | Notes |\n| ------ | ------ | ------ |  ------ |\n| 1-6 | drawChar|Y| draws single  character |\n| 1-6 | drawText |Y| draws character array |\n| 7-12 | drawChar|N| draws single  character |\n| 7-12 | drawText|N| draws character array |\n| 1-12 | print |~| Polymorphic print class which will print out many data types(arduino built in) |\n\nThese  functions return a enum( CH1115_Return_Codes_e), non-zero in event of an error, see API doc.\nBy default only Font 1 is commented in and ready to go to save memory.\nSo to use a non-default Font (2-12), two steps. Comment in the respective define at top of library header file ERM19264_UC1609_graphics_font.h in the USER FONT OPTION ONE section\nCall SetFontNum method and pass it name of respective font.  eg SetFontNum(CH1115Font_Wide).\n\n### Bitmaps\n\nThere is a few different ways of displaying bitmaps, \n\n| Num | Method |    Data addressing | Note |\n| ------ | ------ | ------- |  ------ |  \n| 1 | OLEDBitmap() | Vertical |  Writes directly to screen , no buffer used. | \n| 2 | OLEDBuffer()  |   Vertical  |  Mostly for internal use ... mostly | \n| 3 | buffer init technique  | Vertical  |  Can be used when initialising a buffer, splash screen | \n| 4 | drawBitmap() |   Vertical | default,  setDrawBitmapAddr(true) | \n| 5 | drawBitmap() |  Horizontal | setDrawBitmapAddr(false) |\n\nThe drawBitmap function will return an enum with an error code if an error occurs see API  docs.\nFor a bitmap with horizontally addressed data, the width must be divisible evenly by 8.\nFor a bitmap with vertically addressed data, the height must be divisible evenly by 8.\nSee the bitmap example file for more details on each method. \nBitmaps can be turned to data [here at link]( https://javl.github.io/image2cpp/) .\n\n### User adjustments\n\nWhen the user calls OLEDbegin() to start OLED they can specify a contrast setting from 0x00 to 0xFF. Datasheet says 0x80 is default. User can also change contrast on the fly.\nScreen can be disabled to enter a sleep type mode where OLED draws 500uA.\nScreen pixel colour can be inverted and also screen can be vertically rotated. \n\nThere is a \"fade or breath display effect\". Whose parameters(time brightness) can be adjusted by passing data to function see \"OLEDfadeEffect\" in API and datasheet for more details.\ndefault is 0x81.\n\nThere is a  Horizontal scroll effect. Whose parameters: Time-interval , direction , mode,\ncan be adjusted by passing data to function see \"OLEDscrollSetup\" in API and datasheet for details. defaults are : 6 frames , right , continuous mode.\n\n### Files\n\nX = ER_OLEDM1_CH1115 in tables below\n\n| Src Files | Description  |\n| ------ | ------ |\n| X.hpp | library header file  |\n| X.cpp |  library  source file  |\n| X_graphics.hpp | graphics header file |\n| X_graphics.cpp |  graphics source file |\n| X_graphics_font.hpp |  font file |\n| X_graphics_font.cpp |  font data file |\n\nThe example files are setup for an arduino UNO/NANO \n\n| Examples files ino  | Description | \n| ------ | ------ |  \n| X_BITMAPS | Shows use of bitmaps  | \n| X_GRAPHICS |  Tests use of graphics   | \n| X_FUNCTIONS | Shows misc functions: flip, scroll , rotate, invert etc | \n| X_MBUF | Shows use of shared buffer mode| \n| X_CLOCK | Shows use of shared buffer mode + clock demo| \n| X_TEXT | Shows use of text and fonts, All Fonts must be enabled to work fully  | \n| X_SWSPI | Shows use of software SPI | \n| X_HELLO | Hello world, basic use case | \n\n## Tested_MCU\n\nTested on following MCUs. for the pin connections used \nduring testing see extras folder, GPIO_MCU_used.txt file.\n\n1. Arduino  UNO \u0026 NANO  v3  \n2. ESP8266 \n3. ESP32 \n4. STM32 \"blue pill\"\n5. Arduino Uno R4 Minima\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgavinlyonsrepo%2Fer_oledm1_ch1115","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgavinlyonsrepo%2Fer_oledm1_ch1115","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgavinlyonsrepo%2Fer_oledm1_ch1115/lists"}