The Arduino Video library is a C++ library designed to handle the video output of Arduino boards based on the STM32H7 microcontroller with DSI video interface. DSI stands for Display Serial Interface, which is a serial interface used to connect a display to the microcontroller.
Note: This library works strictly under the ArduinoCore-zephyr core environment. Standard Mbed or non-RTOS Arduino cores are not supported.
This library is based on the graphics primitives of the ArduinoGraphics library and currently supports the Arduino Portenta H7 and Arduino Giga R1 WiFi boards. The library offers two modes of operation for the Portenta H7 board: you can connect the display to the video output via a USB Type-C connection or use the Giga Display Shield. For the Giga R1 board, only the Giga Display Shield is supported.
The library allows you to draw graphics elements on the screen using simple graphics primitives such as lines, circles, images, etc. Additionally, you can integrate third-party graphic libraries like LVGL (v9.x or higher) to achieve more complex GUI.
The library provides methods for initializing the video controller, clearing the screen, and drawing basic graphics elements.
- Handles video output of Arduino boards based on the STM32H7 microcontroller with DSI video interface
- Exclusive compatibility with the ArduinoCore-zephyr RTOS environment
- Allows drawing graphics elements using simple primitives like lines, circles, images, etc.
- Integration of third-party graphic libraries like LVGL (v9.x) for more complex GUI
To use this library, you must have a supported Arduino board, a display, and the ArduinoCore-zephyr installed via the Board Manager. Once you have connected the display to the board, you can include the library in your Arduino sketch and use its functions to draw graphic elements on the screen.
Thanks to smart internal macros, the constructor automatically detects your board type and resolution parameters. Here is a minimal example for the Arduino GIGA R1 WiFi with Giga Display Shield:
#include "Arduino_Video.h"
#include "ArduinoGraphics.h"
// Width, height, and shield type are automatically configured based on your target board!
Arduino_Video Display;
void setup() {
// Initialize the video controller. Returns 0 if successful.
if (Display.begin() != 0) {
while (1); // Stop execution if init fails
}
// Draw a green rectangle that covers the entire display
Display.beginDraw();
Display.clear();
Display.noStroke();
Display.fill(0, 255, 0);
Display.rect(0, 0, Display.width(), Display.height());
Display.endDraw();
}
void loop() { }- ArduinoLogo: This example demonstrates how to display an Arduino logo image on the screen.
- ArduinoLogoDrawing: This example demonstrates how to draw an Arduino logo image using graphics primitives (line, circle, rect, etc.).
- LVGLDemo: This example demonstrates how to create a graphical user interface (GUI) using the LVGL library. It includes the Arduino_GigaDisplayTouch library to handle touch events.
To learn more about usage of this library, you can check out the following guides:
- GIGA Display Shield LVGL Guide.
- GIGA Display Shield Image Orientation Guide
- GIGA Display Shield Image Draw Guide
The API documentation can be found here.