

We will also declare our counter as a global variable, so we can later increment it on the multiple iterations of the Arduino loop function. In our case, we will keep using the connection diagram shown on the previous post, so the SDA pin will be 21 and the SCL will be the 22. Remember from the previous post that the constructor for this class receives as first input the I2C address of the display and as second and third inputs the numbers of the I2C SDA and SCL pins, respectively. Next we will create an object of class SSD1306, which has the methods we are going to use to draw on the display. We will also include the SSD1306.h library, which exposes the functionality needed to draw on the display.
ARDUINO STRING FUNCTIONS CODE
We will start the code by including the Wire.h library, which is needed to interact with the display via I2C.
ARDUINO STRING FUNCTIONS HOW TO
You can check how to wire the ESP32 to the SSD1306 OLED display and how to install the library needed to interact with it on this previous post.įor this tutorial, an Elecrow’s version of the SSD1306 OLED display was used. To illustrate how to do it, we will show a simple counter that will be incremented every second. The objective of this post is to explain how we can change the value of a string drawn in the SSD1306 OLED display, using the Arduino core running on the ESP32. The objective of this post is to explain how we can change the value of a string drawn in the SSD1306 OLED display, using the Arduino core running on the ESP32. For this tutorial, an Elecrow’s version of the SSD1306 OLED display was used.
