-
-
Notifications
You must be signed in to change notification settings - Fork 440
[PXCT-160] Appwizard tutorial #2187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 15 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
21cc3d4
Added skeleton
BenjaminDannegard 52b0171
Added interaction section
BenjaminDannegard 8e1a63c
Added export images
BenjaminDannegard 3401348
Added images
BenjaminDannegard 0e51356
Added last parts
BenjaminDannegard fb77010
Fixed linter issues
BenjaminDannegard 6ff383a
Removed unused images
BenjaminDannegard a9a5f8b
Update content/hardware/10.mega/shields/giga-display-shield/tutorials…
BenjaminDannegard 4ae18d2
Update content/hardware/10.mega/shields/giga-display-shield/tutorials…
BenjaminDannegard 4158f14
Update content/hardware/10.mega/shields/giga-display-shield/tutorials…
BenjaminDannegard d7a179f
Update content/hardware/10.mega/shields/giga-display-shield/tutorials…
BenjaminDannegard 44b8275
Update content/hardware/10.mega/shields/giga-display-shield/tutorials…
BenjaminDannegard 7def7db
Fixed tutorial and images
BenjaminDannegard d1b13e6
Resolved review
BenjaminDannegard 075743a
Added unused image
BenjaminDannegard f4e6c3f
Update content/hardware/10.mega/shields/giga-display-shield/tutorials…
BenjaminDannegard 25d4747
Update content/hardware/10.mega/shields/giga-display-shield/tutorials…
BenjaminDannegard 0aea5ea
Update content/hardware/10.mega/shields/giga-display-shield/tutorials…
BenjaminDannegard 65b99e2
Update content/hardware/10.mega/shields/giga-display-shield/tutorials…
BenjaminDannegard ae8b814
Update content/hardware/10.mega/shields/giga-display-shield/tutorials…
BenjaminDannegard 6cb7bdf
Specified version
BenjaminDannegard 79aec6a
Images added
mcmchris File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file added
BIN
+345 KB
...ds/giga-display-shield/tutorials/13.appwizard-guide/assets/appwizard-button.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+245 KB
...a-display-shield/tutorials/13.appwizard-guide/assets/appwizard-complete-gui.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1020 KB
...ield/tutorials/13.appwizard-guide/assets/appwizard-demo-folder-library-code.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+566 KB
...ay-shield/tutorials/13.appwizard-guide/assets/appwizard-demo-folder-library.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+368 KB
...isplay-shield/tutorials/13.appwizard-guide/assets/appwizard-demo-folder-src.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+620 KB
...isplay-shield/tutorials/13.appwizard-guide/assets/appwizard-examples-folder.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+345 KB
...isplay-shield/tutorials/13.appwizard-guide/assets/appwizard-library-example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+417 KB
...isplay-shield/tutorials/13.appwizard-guide/assets/appwizard-library-include.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+345 KB
...ds/giga-display-shield/tutorials/13.appwizard-guide/assets/appwizard-rotary.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+268 KB
...iga-display-shield/tutorials/13.appwizard-guide/assets/appwizard-screen-box.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+322 KB
...ds/giga-display-shield/tutorials/13.appwizard-guide/assets/appwizard-slider.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+326 KB
...ds/giga-display-shield/tutorials/13.appwizard-guide/assets/appwizard-switch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+289 KB
.../giga-display-shield/tutorials/13.appwizard-guide/assets/appwizard-text-box.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+580 KB
...ields/giga-display-shield/tutorials/13.appwizard-guide/assets/start-project.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
135 changes: 135 additions & 0 deletions
135
...are/10.mega/shields/giga-display-shield/tutorials/13.appwizard-guide/content.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
--- | ||
title: GIGA Display Shield AppWizard Guide | ||
description: 'Learn how to use Segger AppWizard with the GIGA Display Shield.' | ||
author: Benjamin Dannegård | ||
tags: [Display, appwizard, segger, GUI] | ||
--- | ||
|
||
## Introduction | ||
mcmchris marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Segger AppWizard is a graphical framework for building powerful UIs, and is fully compatible with the GIGA Display Shield. It allows you to build UIs, using pre-made widgets like buttons, images, loading bars, sliders, checkboxes, etc. It also allows you to fully customize the screenspace on the display. In this guide, we will go through some of the different components and interactions, so you can learn how to best use AppWizard for your own projects. | ||
BenjaminDannegard marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Specifically, we will show you how to create a screen with AppWizard that includes some of the most common elements: a button, a text label, a progress bar, and a slider. We will also demonstrate how to export the code from AppWizard and create an Arduino library that implements the designed screen. | ||
|
||
## Hardware & Software Needed | ||
|
||
- [Arduino GIGA R1 WiFi](https://store.arduino.cc/products/giga-r1-wifi) | ||
- [Arduino GIGA Display Shield](https://store.arduino.cc/products/giga-display-shield) | ||
- [Arduino IDE](https://www.arduino.cc/en/software) | ||
- [AppWizard](https://www.segger.com/products/user-interface/emwin/tools/appwizard/) | ||
- [emWin Arduino Library](https://github.com/SEGGERMicro/emWin-Arduino-Library/) | ||
|
||
## Downloading the Library and Core | ||
|
||
The GIGA R1 core includes the [Arduino_H7_Video](https://github.com/arduino/ArduinoCore-mbed/tree/main/libraries/Arduino_H7_Video) library that handles the display. | ||
|
||
In this guide, we will be using three different libraries: | ||
- [Arduino_H7_Video](https://github.com/arduino/ArduinoCore-mbed/tree/main/libraries/Arduino_H7_Video), this one is bundled with the core, so make sure you have the latest version of the [Mbed core](https://github.com/arduino/ArduinoCore-mbed) installed. | ||
- [Arduino_GigaDisplayTouch](https://www.arduino.cc/reference/en/libraries/arduino_gigadisplaytouch/), handles touch on the GIGA Display Shield | ||
- [emWin Arduino Library](https://github.com/SEGGERMicro/emWin-Arduino-Library/) | ||
|
||
To install this, open the library manager and install the latest version by searching for **"Arduino_GigaDisplayTouch"**. | ||
|
||
## Creating an App Wizard Project | ||
|
||
First go to **File -> New Project** to start your new project. Here we need to configure certain settings so it will work on the GIGA Display Shield. Set the display size x to **480** and display size y to **800**. Then we need to disable the **Enable simulation** and **Generate loop in MainTask()** options. It should look like the image below. | ||
BenjaminDannegard marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
 | ||
|
||
## Setting Up The Project | ||
First add a **screen** element to your project, this will be the base that contains all the other elements of the project. To add a background color add the **Box** object and set the color on the right side properties menu. | ||
BenjaminDannegard marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
 | ||
|
||
## Creating Objects | ||
|
||
### Button | ||
|
||
Add a button from the object menu. On the right hand properties menu you can set the color of the button when it is unpressed and pressed. | ||
|
||
 | ||
|
||
In the right hand properties menu you can also add text to the button. Press the **set text** option. This will bring up a window that contains all the text elements in the project. Press **add text**, this will create a new text object with a unique id. Now to set the text that will be displayed press **New language** and enter **En**, we will be using English in this tutorial. Under the new **En** tab you can set the text that will be visible, change the **-** to **Button** and this text will be displayed on the button. | ||
|
||
 | ||
|
||
### Slider | ||
|
||
Next create a slider by pressing the **Slider** button on the top left menu. You can configure the visual elements of the slider in the right "Properties" menu. | ||
|
||
 | ||
|
||
### Switch | ||
|
||
Next create a slider by pressing the **Switch** button on the top left menu. You can configure the visual elements of the switch in the right "Properties" menu. | ||
|
||
 | ||
|
||
### Rotary | ||
|
||
Next create a slider by pressing the **Rotary** button on the top left menu. You can configure the visual elements of the rotary in the right "Properties" menu. | ||
|
||
 | ||
|
||
Now the complete project should look like this: | ||
|
||
 | ||
|
||
Let's move on to how we can export this project to be displayed on the GIGA Display Shield. | ||
|
||
## Exporting the Project | ||
|
||
In AppWizard, go to **File -> Export & Save** in the upper left of the window. Now open the folder of the project. Create a new folder which we will put the exported files into, in this new folder create another folder named **src**. Now from the exported project folder, copy all the files contained in the **Resource** and **Source** subfolders (without copying the subfolders themselves) into the newly created **src** folder. Take all the files out of the folders before putting them in the **src** folder, if you have any folders inside of the **src** folder it will not import into the Arduino IDE later. | ||
|
||
 | ||
|
||
Now the folder name needs to be removed from the `#include` directives of the generated files. Inside the **ID_SCREEN_00_Slots.c** file change the `#include "../Generated/Resource.h"` | ||
and `#include "../Generated/ID_SCREEN_00.h"` to `#include "Resource.h"` and `#include "ID_SCREEN_00.h"`. | ||
|
||
 | ||
|
||
When this is done create a **library.properties** file inside the root of the newly created folder. Then put this text into the file, you can change the name to whatever you like: | ||
|
||
```arduino | ||
name=AppWizardDemoLib | ||
BenjaminDannegard marked this conversation as resolved.
Show resolved
Hide resolved
|
||
version=1.0.0 | ||
author=SEGGER Microcontroller GmbH | ||
maintainer=SEGGER Microcontroller GmbH info@segger.com | ||
sentence= | ||
paragraph= | ||
category=Display | ||
url= | ||
architectures= | ||
includes= | ||
depends= | ||
``` | ||
|
||
 | ||
|
||
And lastly to create the Arduino sketch. Create an **examples** folder inside the root of the newly created folder, inside this **examples** folder you can create another folder containing the **demo.ino** file. Use the following code for the **demo.ino**: | ||
BenjaminDannegard marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
```arduino | ||
#include <Resource.h> | ||
void setup() { | ||
MainTask(); | ||
} | ||
void loop() { | ||
GUI_Exec(); | ||
} | ||
``` | ||
|
||
 | ||
|
||
Now all that is left is to import this whole folder as a library into the Arduino IDE. First compress the folder into a .zip format. And then in the Arduino IDE go to **Sketch -> Include library -> Add .ZIP Library**. Then select the created .zip file and add it. | ||
BenjaminDannegard marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
 | ||
|
||
Now the demo sketch should be accessible under the examples tab inside the library. The library will have the name given inside the **library.properties** file. | ||
|
||
 | ||
|
||
Now select your board and upload the sketch. The GUI created in AppWizard should now display on the GIGA Display Shield! | ||
|
||
mcmchris marked this conversation as resolved.
Show resolved
Hide resolved
|
||
### Conclusion | ||
|
||
Now you have an idea of how to use the basic features of AppWizard! This tutorial went through how easy it is to import your design to your Arduino board using the Arduino IDE. You are now ready to create your own design and play around with AppWizard! |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.