Bonezegei SSD1306: Arduino Library for 128x64 OLED Display
Batutay, Jofel ยท 2023/10/27

Bonezegei SSD1306 is an Arduino library that allows users to easily interface with 128x64 OLED displays. The library provides functions for drawing text and some basic shapes. The library supports both I2C communication protocol, and is compatible with various Arduino boards and shields. Bonezegei SSD1306 aims to offer a simple and efficient way to create interactive and dynamic user interfaces for microcontroller based projects. Follow the installation steps at https://bonezegei.com on how to install bonezegei libraries on Arduino IDE (Batutay, 2023).

Disclaimer

The code and libraries provided by Bonezegei is intended for informational and educational purposes only. Bonezegei does not own or manufacture the hardware associated with the code. The code is provided "as is" without any warranty, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, and non-infringement. In no event shall Bonezegei be liable for any claim, damages, or other liability arising from the use of the code or the hardware. Users are solely responsible for ensuring that their use of the code complies with all applicable laws and regulations.


1. Hello World

Print Text on the Screen with default Font

/*
  OLED TextHelloWorld
  Author: Bonezegei (Jofel Batutay)
  Date: August 2023 
*/

//TextHelloWorld
#include <Bonezegei_SSD1306.h>
Bonezegei_SSD1306 oled(128, 64);

void setup() {
  oled.begin();
  oled.clear();
  oled.drawText(10, 0, "Hello World" , 1, arial_8ptBitmaps, arial_8ptDescriptors);
  oled.draw();  //update the screen
}

void loop() {
  String s = "milis:" ;
  s += millis();

  oled.drawFilledRectangle(0, 20, 127, 30, 0);
  oled.drawText(0, 20, s.c_str(), 1, arial_8ptBitmaps, arial_8ptDescriptors);
  oled.draw();  //update the screen
  delay(100);
}

2. Hello World Invert Text

Invert Text

/*
  OLED Inverted Text
  Author: Bonezegei (Jofel Batutay)
  Date: August 2023 
*/

//TextHelloWorld
#include <Bonezegei_SSD1306.h>
Bonezegei_SSD1306 oled(128, 64);

void setup() {
  oled.begin();
  oled.clear();
  oled.drawText(1, 0, "Hello World" , arial_8ptBitmaps, arial_8ptDescriptors);
  oled.draw();  //update the screen
}

void loop() {
  String s = "milis:" ;
  s += millis();

  oled.drawFilledRectangle(0, 19, 127, 30, 1);
  oled.drawText(1, 20, s.c_str(), 0, arial_8ptBitmaps, arial_8ptDescriptors); //invert text set color to 0
  oled.draw();  //update the screen
  delay(1);
}

3. Rectangles

Basic Rectangle on OLED

/*
  OLED Rectangle 128x64 SSD1306 OLED
  Author: Bonezegei (Jofel Batutay)
  Date: August 2023 
*/

#include <Bonezegei_SSD1306.h>
Bonezegei_SSD1306 oled(128,64);

void setup() {

  oled.begin();
  oled.clear();

  oled.drawFilledRectangle(20,2,100,15);
  oled.drawFilledRectangle(20,20,100,32);
  oled.draw(); //update the screen
}

void loop() {
}

References

  1. Batutay, Jofel. (2023). Arduino Library Installation. Bonezegei. https://bonezegei.com/?c=resources/tutorial&&d=resources/tutorial/libraries/install&&nav=1

Cite this

  1. Batutay, Jofel. (2023). Bonezegei SSD1306: Arduino Library for 128x64 OLED Display. ResearchGate. https://doi.org/10.13140/RG.2.2.13909.60648.