OLED Display
Last updated
Was this helpful?
Last updated
Was this helpful?
You know how to get a handle on the OLED Display connected to your computer
You can write text and clear the display.
We can use the to output information to the user of our application. Using the , we get easy to use functions to perform the most important tasks. In this article, we assume you have successfully initialized the devices with the , and you stored all connected devices on a global variable devices
. We also declared a global variable oledDisplay
.
Next, we need to know the device identifier of the OLED Display. Depending on the size of the display, the identifier is either 263 (128 x 64) or 264 (64x48). In this example, we have the former:
Now that we have a reference to the display on the variable oledDisplay
, we can use that variable to call the display's functions.
Writing text to the display is straightforward. The function write()
takes 3 arguments: The first two are the line number and the column number where the text should show up. The last argument is the text itself:
You can clear the whole display:
Or you can clear just a single line: