Skip to content

Commit 1aebbfb

Browse files
Added screenshots
1 parent 9a3687f commit 1aebbfb

File tree

5 files changed

+184
-10
lines changed

5 files changed

+184
-10
lines changed

content/hardware/10.mega/shields/giga-display-shield/tutorials/10.square-line-tutorial/assets/export_options.svg

Lines changed: 27 additions & 0 deletions
Loading

content/hardware/10.mega/shields/giga-display-shield/tutorials/10.square-line-tutorial/assets/folder_structure.svg

Lines changed: 31 additions & 0 deletions
Loading

content/hardware/10.mega/shields/giga-display-shield/tutorials/10.square-line-tutorial/assets/project_settings.svg

Lines changed: 44 additions & 0 deletions
Loading

content/hardware/10.mega/shields/giga-display-shield/tutorials/10.square-line-tutorial/assets/squareline_studio_project.svg

Lines changed: 15 additions & 0 deletions
Loading
Lines changed: 67 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,89 @@
11
---
2-
title: Square Line With the GIGA Display Shield
3-
description: "Learn how to use Square Line to create LVGL elements for the GIGA Display Shield"
2+
title: SquareLine Studio With the GIGA Display Shield
3+
description: "Learn how to use SquareLine Studio to create LVGL elements for the GIGA Display Shield"
44
author: Benjamin Dannegård
5-
tags: [Display, square line, LVGL]
5+
tags: [Display, squareline, LVGL]
66
---
77

8-
8+
The GIGA Display Shield with the GIGA R1 WiFi board can run LVGL which allows for the creation of GUIs. To make the design of the GUI easier we can use the software SquareLine Studio. This will allow us to drag and drop different elements and then export it for usage on the display shield.
99

1010
## Hardware & Software Needed
1111

1212
- [Arduino GIGA R1 WiFi](https://store.arduino.cc/products/giga-r1-wifi)
1313
- [Arduino GIGA Display Shield](https://store.arduino.cc/products/giga-display-shield)
1414
- [Arduino IDE](https://www.arduino.cc/en/software)
15+
- [SquareLine Studio](https://squareline.io/)
1516

1617
## Downloading the Library and Core
1718

18-
Make sure the latest GIGA Core is installed in the Arduino IDE. **Tools > Board > Board Manager...**. Here you need to look for the **Arduino Mbed OS Giga Boards** and install it, the [Arduino_H7_Video library](https://github.com/arduino/ArduinoCore-mbed/tree/main/libraries/Arduino_H7_Video) is included in the core. Now you have to install the library needed. Go to **Tools > Manage libraries..**, search for **LVGL**, and install it.
19+
Make sure the latest GIGA Core is installed in the Arduino IDE. **Tools > Board > Board Manager...**. Here you need to look for the **Arduino Mbed OS Giga Boards** and install it, the [Arduino_H7_Video library](https://github.com/arduino/ArduinoCore-mbed/tree/main/libraries/Arduino_H7_Video) is included in the core. Now you have to install the library needed. Go to **Tools > Manage libraries..**, search for [**LVGL**](https://github.com/lvgl/lvgl) and [**Arduino_GigaDisplayTouch**](https://github.com/arduino-libraries/Arduino_GigaDisplayTouch), install both of these libraries.
20+
21+
## Using SquareLine Studio
22+
23+
First download SquareLine Studio from the link above. Now in SquareLine Studio go to the "create" section and select the Arduino tab. On the right you can set the "project settings". These needs to be set like so:
24+
25+
- **Project name**: Set the name of your project
26+
- **Resolution**: 800x480 (to fully use the 800x480 screen in landscape mode, select 480x800 for portrait)
27+
- **Color depth**: 16 bit
28+
- **LVGL version**: 8.3.x
29+
30+
As show on this image:
31+
32+
![Project settings in SquareLine Studio](assets/project_settings.svg)
33+
34+
Finally click on the "create" button.
35+
36+
### Creating the GUI
37+
38+
Now it is time to create the GUI that will be on the display shield. Feel free to customize your GUI however you want. On the left there are plenty of handy widgets that can be drag and dropped. On the right you can set more specific options for the widgets.
39+
40+
![Project in SquareLine Studio](assets/squareline_studio_project.svg)
41+
42+
### Exporting a Project From SquareLine Studio
43+
44+
Now that the project is ready it is time to export it. First click on the "Export" tab at the top, then select "Create Template Project" and select the destination for your exported files. When that is done click on the "Export UI Files" and wait for the process to finish.
45+
46+
![Export options in SquareLine Studio](assets/export_options.svg)
47+
48+
Now all the files should be in the folder that you specified.
49+
50+
### Running the SquareLine Studio Project on Arduino IDE
51+
52+
In the folder that you exported the files to, go into the "libraries" folder and then copy the "ui" folder.
53+
54+
![Folder structure of the exported files](assets/folder_structure.svg)
55+
56+
Place this folder in your **Arduino->Libraries** folder.
57+
58+
Now to run the SquareLine Studio project, use this sketch:
59+
60+
```arduino
61+
#include "Arduino_H7_Video.h"
62+
#include "Arduino_GigaDisplayTouch.h"
1963
20-
## Downloading Square Line
64+
#include "lvgl.h"
65+
#include "ui.h"
2166
67+
/* Insert resolution WxH according to your SquareLine studio project settings */
68+
Arduino_H7_Video Display(800, 480, GigaDisplayShield);
69+
Arduino_GigaDisplayTouch Touch;
2270
23-
### Using Square Line
71+
void setup() {
72+
Display.begin();
73+
Touch.begin();
2474
75+
ui_init();
76+
}
2577
26-
### Running the Square Line Project on Arduino IDE
78+
void loop() {
2779
28-
### Results
80+
/* Feed LVGL engine */
81+
lv_timer_handler();
82+
}
83+
```
2984

30-
## Testing It Out
85+
## Next Step
3186

87+
If you are curious about how LVGL works with the GIGA Display Shield, take a look at our [LVGL Guide](/tutorials/giga-display-shield/lvgl-guide).
3288

89+
LVGL can also be used in combination with the sensors on the display shield. Have a look at our [Image Orientation tutorial](/tutorials/giga-display-shield/image-orientation).

0 commit comments

Comments
 (0)