|
| 1 | +--- |
| 2 | +title: 'Getting Started with the GIGA Display Shield' |
| 3 | +description: 'Learn how to set up and use the GIGA Display Shield and get an overview of the features.' |
| 4 | +author: 'Karl Söderby' |
| 5 | +tags: [Displays, LVGL, GIGA, IMU] |
| 6 | +--- |
| 7 | + |
| 8 | +The [GIGA Display Shield](/hardware/giga-display-shield) is an accessory shield designed for the [GIGA R1 WiFi](/hardware/giga-r1) board. With it, you can render fast & sophisticated user interfaces on a **800x480** display with **touch support**. |
| 9 | + |
| 10 | +In this guide you will learn how to set your board up with the GIGA R1 WiFi board & become familiar with the available libraries to control it. |
| 11 | + |
| 12 | +## Hardware & Software Needed |
| 13 | + |
| 14 | +- [GIGA R1 WiFi](/hardware/giga-r1). |
| 15 | +- [GIGA Display Shield](/hardware/giga-display-shield) |
| 16 | +- [Arduino IDE](https://www.arduino.cc/en/software) |
| 17 | + |
| 18 | +## Overview |
| 19 | + |
| 20 | +There are three official libraries available to use the display & touch interface: |
| 21 | +- [Arduino_H7_Video](https://github.com/arduino/ArduinoCore-mbed/tree/main/libraries/Arduino_H7_Video) - manages the video output and integrates third party libraries such as [LVGL](https://lvgl.io/) and [emWin](https://www.segger.com/products/user-interface/emwin/). This library is used to configure and initialize the display and to perform basic draw functions. |
| 22 | +- [ArduinoGraphics](https://www.arduino.cc/reference/en/libraries/arduinographics/) - a graphics primitive library that provides draw, text and animation functions. |
| 23 | +- [Arduino_GigaDisplayTouch](https://github.com/arduino-libraries/Arduino_GigaDisplayTouch) - to handle the touch interface of the display. |
| 24 | + |
| 25 | +The above libraries provides a basic set of functionalities. To build more sophisticated UI's, frameworks such as [LVGL](https://lvgl.io/) is required. |
| 26 | + |
| 27 | +The LVGL framework allows you to build user interfaces using existing widgets such as buttons, gauges, text fields, drop down menus and much more. |
| 28 | + |
| 29 | +***To get started with LVGL and get access to some useful examples, visit the [Guide to LVGL with GIGA Display Shield](/tutorials/giga-display-shield/lvgl-guide) tutorial.*** |
| 30 | + |
| 31 | +## Installation |
| 32 | + |
| 33 | +The GIGA Display Shield requires you to install the core for GIGA boards, along with some additional software libraries. |
| 34 | + |
| 35 | +### Install GIGA Core |
| 36 | + |
| 37 | +To use the shield you will need to have a GIGA R1 WiFi board. To use the GIGA R1 WiFi, you will need to install the **GIGA core**, which can be done directly in the Arduino IDE, under "Board Manager". |
| 38 | + |
| 39 | + |
| 40 | + |
| 41 | +***For more details, see [Getting Started with GIGA R1 WiFi](/tutorials/giga-r1-wifi/giga-getting-started).*** |
| 42 | + |
| 43 | + |
| 44 | +### Install ArduinoGraphics |
| 45 | + |
| 46 | +The [ArduinoGraphics](https://www.arduino.cc/reference/en/libraries/arduinographics/) is required for drawing operations on the screen. |
| 47 | + |
| 48 | +You can install it directly in the IDE, in the "Library Manager": |
| 49 | + |
| 50 | + |
| 51 | + |
| 52 | +***For source code and issues with the ArduinoGraphics library, please see the [GitHub repository](https://github.com/arduino-libraries/ArduinoGraphics).*** |
| 53 | + |
| 54 | +### Install Arduino_GigaDisplayTouch |
| 55 | + |
| 56 | +The [Arduino_GigaDisplayTouch](https://www.arduino.cc/reference/en/libraries/arduino_gigadisplaytouch/) is required for reading touch points on the screen, and is needed when using the LVGL's framework. |
| 57 | + |
| 58 | + |
| 59 | + |
| 60 | +***For source code and issues with the Arduino_GigaDisplayTouch library, please see the [GitHub repository](https://github.com/arduino-libraries/Arduino_GigaDisplayTouch).*** |
| 61 | + |
| 62 | +## Hardware Setup |
| 63 | + |
| 64 | +To use the GIGA Display Shield, mount it on the **bottom** side of the GIGA R1 WiFi board. The GIGA R1 WiFi board will be flipped upside down when the display is used. |
| 65 | + |
| 66 | + |
| 67 | + |
| 68 | +### Camera Connector |
| 69 | + |
| 70 | +Located on the top side of the shield is a camera connector that enables when you connect it to the GIGA R1 WiFi board. |
| 71 | + |
| 72 | +## IMU |
| 73 | + |
| 74 | +This shield has a built-in IMU module, the **BMI270**. This sensor can be used for a number of purposes, for example to automatically orientate an object on the screen, see the following tutorial: |
| 75 | + |
| 76 | +- [Giga Display Shield Automatic Orientation](/tutorials/giga-display-shield/image-orientation) |
| 77 | + |
| 78 | +To access **BMI270**, use the [BMI270-250](https://www.arduino.cc/reference/en/libraries/arduino_bmi270_bmm150/) library. Please note that the sensor is not connected to the main I2C bus, so you will need to initialize the sensor on another bus. To do so, simply add the line below to the top of your sketch: |
| 79 | + |
| 80 | +```arduino |
| 81 | +BoschSensorClass imu(Wire1); |
| 82 | +``` |
| 83 | + |
| 84 | +Note that the examples uses the default `IMU` (uppercase) class, which you will need to replace. Example: |
| 85 | + |
| 86 | +``` |
| 87 | +IMU.begin() //for other boards |
| 88 | +imu.begin() //for GIGA Display Shield |
| 89 | +``` |
| 90 | + |
| 91 | +## Microphone |
| 92 | + |
| 93 | +This shield has an embedded omnidirectional microphone, **MP34DT06JTR**, which can be used to together with the [PDM](https://docs.arduino.cc/learn/built-in-libraries/pdm) library. This library is shipped with the GIGA core, so there's no need to install it. |
| 94 | + |
| 95 | +Below is a minimal sketch that will print out the samples in the serial plotter (a tool that is part of the Arduino IDE). |
| 96 | + |
| 97 | +<CodeBlock url="https://github.com/arduino/ArduinoCore-mbed/blob/main/libraries/PDM/examples/PDMSerialPlotter/PDMSerialPlotter.ino" className="arduino"/> |
| 98 | + |
| 99 | +## RGB |
| 100 | + |
| 101 | +This shield has a built in RGB pixel that is controlled via I2C. To use this, install the [Arduino_GigaDisplay](https://github.com/arduino-libraries/Arduino_GigaDisplay) library. The following sketch is a minimal example that will blink the blue pixel every second. |
| 102 | + |
| 103 | +```arduino |
| 104 | +#include <Arduino_GigaDisplay.h> |
| 105 | +
|
| 106 | +GigaDisplayRGB rgb; //create rgb object |
| 107 | +
|
| 108 | +void setup() { |
| 109 | + rgb.begin(); //init the library |
| 110 | +} |
| 111 | +
|
| 112 | +void loop() { |
| 113 | + rgb.on(0, 0, 255); //turn on blue pixel |
| 114 | + delay(1000); |
| 115 | + rgb.off(); //turn off all pixels |
| 116 | + delay(1000); |
| 117 | +} |
| 118 | +``` |
| 119 | + |
| 120 | +## Summary |
| 121 | + |
| 122 | +In this guide we have covered the requirements & installation needs for using the GIGA Display Shield, as well as demonstrating how to access the RGB, IMU & Microphone peripherals. |
| 123 | + |
| 124 | +For more tutorials, visit the [documentation page for GIGA Display Shield](/hardware/giga-display-shield). |
0 commit comments