Skip to content

Commit 8e1a63c

Browse files
Added export images
1 parent 52b0171 commit 8e1a63c

File tree

8 files changed

+59
-5
lines changed

8 files changed

+59
-5
lines changed
Loading
Loading
Loading
Loading
Loading
Loading
Loading

content/hardware/10.mega/shields/giga-display-shield/tutorials/13.appwizard-guide/content.md

Lines changed: 59 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Add a button from the object menu. On the right hand properties menu you can set
5353

5454
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.
5555

56-
[Text objects box]()
56+
![Text objects box]()
5757

5858
## Adding Interactions
5959

@@ -79,18 +79,72 @@ To add the buttons interaction, set the emitter as the button, the signal should
7979

8080
### Progress Bar
8181

82-
Now lets try adding a progress bar to the previous interaction. Start by pressing the **progbar** button and set the initial value to "0".
82+
Now lets try adding a progress bar to the previous interaction. Start by pressing the **progbar** button and set the initial value to "0". Set the min value to "0" and max value to "100". Now add an interaction with the emitter as the button variable, the signal to "VALUE_CHANGED", job as "SETVALUE" and the receiver as the progress bar. Now try it out in play mode and you will see the progress bar increase whenever the button is pressed.
8383

84+
### Slider And Gauge
8485

85-
### Gauge
86+
Now let's try adding a slider and gauge to the project. Press the **Gauge** button in the top left menu. Set initial value to "0", the min value to "0" and max value to "100".
8687

87-
### Slider
88+
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.
8889

90+
![Project with slider and guage]()
8991

92+
Now there needs to be a variable that will keep track of the value, press the **Open variables window** button in the bottom left.
93+
94+
![Variable window button highlighted]()
95+
96+
Press **Add variable** and then rename the variable to something relevant so it is easier to keep track of later, here we will name it "ID_SLIDER_VAR".
97+
98+
![Variable window]()
99+
100+
Now to add the interaction that will fill the gauge when the slider is moved. First, create a new interaction, set the emitter as the slider variable, the signal should be "VALUE_CHANGED". The job should be "SETVALUE" and the receiver should be the gauge. Now create the interaction that makes the slider change the variable. Create a new interaction and set the emitter as the slider, the signal should be "VALUE_CHANGED". The job should be "SETVALUE" and the receiver should be the slider variable.
101+
102+
![Image of all the interactions]()
90103

91104
## Exporting the project
92105

93-
##
106+
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 the content from the **Resource** and **Source** folders into the newly created **src** folder.
107+
108+
![Folder structure](assets/appwizard-demo-folder-src.png)
109+
110+
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"`
111+
and `#include "../Generated/ID_SCREEN_00.h"` to `#include "Resource.h"` and `#include "ID_SCREEN_00.h"`.
112+
113+
![Screenshot of code](assets/appwizard-demo-folder-library-code.png)
114+
115+
When this is done create a **library.properties** file inside the root of the newly created folder. Then put this text into the file:
116+
117+
```arduino
118+
name=AppWizardDemoLib
119+
version=1.0.0
120+
author=SEGGER Microcontroller GmbH
121+
maintainer=SEGGER Microcontroller GmbH [email protected]
122+
sentence=
123+
paragraph=
124+
category=Display
125+
url=
126+
architectures=
127+
includes=
128+
depends=
129+
```
130+
131+
![Folder with library properties file](assets/appwizard-demo-folder-library.png)
132+
133+
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**:
134+
135+
```arduino
136+
#include <Resource.h>
137+
void setup() {
138+
MainTask();
139+
}
140+
void loop() {
141+
GUI_Exec();
142+
}
143+
```
144+
145+
![Examples folder structure](assets/appwizard-examples-folder.gif)
146+
147+
Now all that is left is to import this whole folder as a library into the Arduino IDE.
94148

95149
## Conclusion
96150

0 commit comments

Comments
 (0)