oled i2c display with arduino tutorial
As part of our learning experience or academics, I am sure we will do some or other projects.
We will definitely want to display some data on our micro-computers.
Controllers, show some information from sensors or simply, so here\'s a quick tutorial on OLED displays in which we\'ll learn how to connect and program 0.
96 inch OLED display with Arduino micro controller.
So keep track of this instructions and understand and display your own information on an OLED display.
We only need 3 things for this tutorial. 1. 0.
96 \"OLED display Arduino Uno/Nano: Cable: This OLED works on I2C communication and we have to connect 4 pins of ArduinoOLED to Sck (i. e. clock), SDA (i. e. Data)
And power pin I.
VCC and ground.
On the Arduino UNO board, we have SDA for A4 and SCK for a5.
We know that each I2C device has a different hexadecimal address.
Since this OLED uses the I2C communication protocol, we have to find the I2C address of the display.
This can be done by uploading the following code to the motherboard in the case of connecting the device.
Before you look at the code, you need to include the following libraries in the IDE.
You can include these libraries by following the steps.
Otherwise, you can install it externally using the following link.
Check if everything is OK, let\'s run a sample file to test the display.
Once uploaded, you will see the test animation on the screen, which means that you have successfully set the oled.
To write our own message, we first open a new sketch on the IDE, then include these 4 libraries in the title, and then write the reset protocol.
Now, in void setup, we will start to display and clear it, here we have (0 x3C )
As the I2C address of the Hex, so change it as shown in step 4 in the Void Loop and we will write our main code I. e.
The message we want to display needs to describe the text size, text color, cursor position, and then finally write the message using the println command. Don\'t forget to write the display.
Show otherwise we will get a blank screen.
If tracked correctly, the output of the following code should be like this. . . .