The 128×64 I2C/SPI OLED display is often included in a myriad of projects that need some way to show data, including text, shapes, or basic graphs. YouTuber ‘upir’ was able to take this concept one step further by turning his graphic OLED screen into a virtual circular dial that can respond in real-time to an external potentiometer connected to an Arduino Uno using the U8glib library.
His very thorough video steps through the entire process of creating this setup, as everything from wiring to advanced graphics programming is covered. He started by flashing some demo code that takes continuous readings from a potentiometer via an ADC pin and showing the numeric value as text. After knowing that the values can be read correctly, upir then began work on the dial itself, which works by placing a series of tick marks at predetermined distances from each other. Lastly, value labels were included below every increment of 10 for improved readability.
Originally, the system achieved an average of 10 FPS, but upir wanted to push it even further for maximum performance. Sending new pixel values to the screen caused the pixel calculations to be run multiple times, so by placing the intermediate data into a series of buffers and only drawing pixels once per page instead, a new FPS of 27.53 was achieved — an almost 3x improvement.