How to vertical and horizontal center align text/number on OLED
How to vertical and horizontal center align text/number on OLED display?
The below code automatically vertical and horizontal center aligns text/number on OLED, regardless of text size.
- Wiring Diagram
This image is created using Fritzing. Click to enlarge image
- On Arduino IDE, Go to Tools Manage Libraries
- Search “SSD1306”, then find the SSD1306 library by Adafruit
- Click Install button to install the library.
- You will be asked for intalling some other library dependencies
- Click Install All button to install all library dependencies.
- Copy the above code and open with Arduino IDE
- Click Upload button on Arduino IDE to upload code to Arduino
- See text on OLED
Learn more on Arduino - OLED tutorial
|1 × Arduino UNO Buy on Amazon|
|1 × USB 2.0 cable type A/B Buy on Amazon|
|1 × Jumper Wires Buy on Amazon|